spatial.tools (version 1.6.0)

raster_to_filenames: 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.

Value

Character vector of filenames.

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 "".

See Also

filename

Examples

Run this code
# NOT RUN {
{ 
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)
}
# }

Run the code above in your browser using DataCamp Workspace