View source: R/create-daylengths.R
create_daylength_rst | R Documentation |
Generate a multi-layer SpatRaster of day lengths for a given template.
The package geosphere
is required to use this function.
create_daylength_rst(
template,
dates = terra::time(template),
crs = "EPSG:4258",
.quiet = FALSE
)
template |
(Multi-layer) SpatRaster that determines the spatial extent of the result. |
dates |
Dates that should be processed. If not specified, the dates of
|
crs |
Coordinate reference system with longitude/latitude metrics. It is used to project the raster coordinates to be able to retrieve the latitude. |
.quiet |
If |
A multi-layer SpatRaster. Each layer represents one date.
create_daylength_df()
# calculate day length, use barrks_data()$tmin as template
dl <- create_daylength_rst(barrks_data()$tmin, .quiet = TRUE)
# plot day length on May 1st, 2015
terra::plot(dl[[terra::time(dl) == '2015-05-01']])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.