parse_raster_dates: Parse data cube layer names into dates

View source: R/utils.R

parse_raster_datesR Documentation

Parse data cube layer names into dates

Description

label_raster_stack() labels the layers of a data cube with the associated week dates in the format of "wYYYY.MM.DD", because of constraints in the raster package. This function converts that character vector into an ISO compliant Date vector.

Usage

parse_raster_dates(x)

Arguments

x

Raster object; labeled Status and Trends data cube.

Value

Date vector.

Examples

## Not run: 
# download example data
path <- ebirdst_download("example_data")
# or get the path if you already have the data downloaded
path <- get_species_path("example_data")

# weekly relative abundance
# note that only low resolution (lr) data are available for the example data
abd <- load_raster(path, "abundance", resolution = "lr")

# parse dates
parse_raster_dates(abd)

## End(Not run)

CornellLabofOrnithology/ebirdst documentation built on Feb. 1, 2023, 8:44 a.m.