The label_raster_stack() function labels the dates of the estimate rasters in the format of "XYYYY.MM.DD", because of constraints in the raster package. This function converts that character vector into an ISO compliant Date vector.

parse_raster_dates(x)

Arguments

x

Raster object; full or subset of original eBird Status and Trends product raster GeoTIFF.

Value

Date vector.

Examples

# download and load example abundance data sp_path <- ebirdst_download("example_data")
#> Data already exists, use force = TRUE to re-download.
abd <- load_raster("abundance", sp_path) # parse dates parse_raster_dates(abd)
#> [1] "2018-01-04" "2018-01-11" "2018-01-18" "2018-01-25" "2018-02-01" #> [6] "2018-02-08" "2018-02-15" "2018-02-22" "2018-03-01" "2018-03-08" #> [11] "2018-03-15" "2018-03-22" "2018-03-29" "2018-04-05" "2018-04-12" #> [16] "2018-04-19" "2018-04-26" "2018-05-03" "2018-05-10" "2018-05-17" #> [21] "2018-05-24" "2018-05-31" "2018-06-07" "2018-06-14" "2018-06-21" #> [26] "2018-06-28" "2018-07-06" "2018-07-13" "2018-07-20" "2018-07-27" #> [31] "2018-08-03" "2018-08-10" "2018-08-17" "2018-08-24" "2018-08-31" #> [36] "2018-09-07" "2018-09-14" "2018-09-21" "2018-09-28" "2018-10-05" #> [41] "2018-10-12" "2018-10-19" "2018-10-26" "2018-11-02" "2018-11-09" #> [46] "2018-11-16" "2018-11-23" "2018-11-30" "2018-12-07" "2018-12-14" #> [51] "2018-12-21" "2018-12-28"