The filename in Raster packages returns an empty string for a RasterStack. This function will return a vector of length 1 (RasterLayer or RasterBrick) or length >1 for RasterStack. This is mostly just a wrapper aroung filename

Filenames(obj)

# S4 method for ANY
Filenames(obj)

# S4 method for Raster
Filenames(obj)

# S4 method for RasterStack
Filenames(obj)

# S4 method for environment
Filenames(obj)

# S4 method for list
Filenames(obj)

Arguments

obj

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