label_raster_stack: Labels 52 week RasterStack with the dates for each band

Description Usage Arguments Value Examples

View source: R/ebirdst-loading.R

Description

The raster package does not allow layer names to be saved with the bands of a multi-band GeoTIFF. Accordingly, all eBird Status and Trends products raster results cover the entire 52 week temporal extent of analysis. For convenience, this function labels the RasterStack once it has been loaded with the dates for each band.

Usage

1

Arguments

x

RasterStack or RasterBrick; original eBird Status and Trends product raster GeoTIFF with 52 bands, one for each week.

Value

A RasterStack or RasterBrick with names assigned for the dates in the format of "XYYYY.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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
# download and load example abundance data
sp_path <- ebirdst_download("example_data")
abd <- load_raster("abundance", sp_path)

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

## End(Not run)

ebirdst documentation built on Jan. 16, 2021, 5:16 p.m.