label_raster_stack: Label data cubes with the week date for each band
Description
The data cubes are saved as GeoTIFFs, which don't allow for band labels. For
convenience, this function labels the layers of a data cube once it has been
loaded with the week dates for each band.
Usage
label_raster_stack(x)
Arguments
x
RasterStack or RasterBrick; original eBird Status and Trends
data cube with 52 bands, one for each week.
Value
A RasterStack or RasterBrick with names assigned for the dates in
the format of "wYYYY.MM.DD" per raster package constraints. The Raster*
objects do not allow the names to start with a number, nor are they allowed
to contain "-", so it is not possible to store the date in an ISO compliant
format. Use parse_raster_dates() to convert the layer names to dates.
# NOT RUN {# download and load example abundance datasp_path <- ebirdst_download("example_data")
abd <- load_raster(sp_path, "abundance")
# labelabd <- label_raster_stack(abd)
names(abd)
# }