raster_to_filenames {spatial.tools}R Documentation

Extract filenames from all Raster* objects.

Description

Extract filenames from all Raster* objects.

Usage

raster_to_filenames(x, unique = FALSE)

Arguments

x

Raster*. A Raster* object (even one without values/in memory) to determine the filename(s).

unique

Logical. Only return unique filenames? If FALSE, one filename per layer.

Details

This is an expansion of filename() that allows for RasterStacks, in-memory Raster*s, and Raster*s without values. If a filename is not found, the entry will be "".

Value

Character vector of filenames.

Author(s)

Jonathan A. Greenberg

See Also

filename

Examples

{ 
library("raster")
tahoe_highrez <- brick(system.file("external/tahoe_highrez.tif", package="spatial.tools"))
raster_to_filenames(tahoe_highrez)
raster_to_filenames(tahoe_highrez,unique=TRUE)
nodata <- raster()
raster_to_filenames(nodata)
}

[Package spatial.tools version 1.6.1 Index]