This is mostly just a wrapper around filename from the raster package, except that instead of returning an empty string for a RasterStack object, it will return a vector of length >1 for RasterStack.

Filenames(obj, allowMultiple = TRUE)

# S4 method for ANY
Filenames(obj, allowMultiple = TRUE)

# S4 method for environment
Filenames(obj, allowMultiple = TRUE)

# S4 method for list
Filenames(obj, allowMultiple = TRUE)

Arguments

obj

A Raster* object (i.e., RasterLayer, RasterStack, RasterBrick)

allowMultiple

Logical. If TRUE, the default, then all relevant filenames will be returned, i.e., in cases such as .grd where multiple files are required. If FALSE, then only the first file will be returned, e.g., filename.grd, in the case of default Raster format in R.

Value

A character vector of filenames that are part of the objects passed to obj. This returns NULL is the object is not file-backed or does not have a method to recover the file-backed filename.

Details

New methods can be made for this generic.

Author

Eliot McIntire