Learn R Programming

ebirdst (version 0.3.3)

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.

Examples

Run this code
# NOT RUN {
# download and load example abundance data
sp_path <- ebirdst_download("example_data")
abd <- load_raster(sp_path, "abundance")

# label
abd <- label_raster_stack(abd)
names(abd)
# }

Run the code above in your browser using DataLab