Learn R Programming

ebirdst (version 2.2021.1)

parse_raster_dates: Parse weekly dates from raster layer names

Description

The dates corresponding to each layer of a weekly data cube are stored as the layer names. This function converts these to Date objects.

Usage

parse_raster_dates(x)

Value

Date vector.

Arguments

x

SpatRaster object; weekly Status and Trends data cube.

Examples

Run this code
if (FALSE) {
# 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
abd_weekly <- load_raster(path, "abundance", resolution = "lr")

# dates corresponding to each week
parse_raster_dates(abd_weekly)
}

Run the code above in your browser using DataLab