get_daymet {FedData} | R Documentation |
Download and crop the 1-km DAYMET v4 daily weather dataset.
Description
get_daymet
returns a SpatRaster
of weather data cropped to a given
template study area.
Usage
get_daymet(
template,
label,
elements = c("dayl", "prcp", "srad", "swe", "tmax", "tmin", "vp"),
years = 1980:(lubridate::year(Sys.time()) - 1),
region = "na",
tempo = "day",
extraction.dir = file.path(tempdir(), "FedData", "extractions", "daymet", label),
raster.options = c("COMPRESS=DEFLATE", "ZLEVEL=9", "INTERLEAVE=BAND"),
force.redo = FALSE,
progress = TRUE
)
Arguments
template |
An |
label |
A character string naming the study area. |
elements |
A character vector of elements to extract. |
years |
A numeric vector of years to extract. |
region |
The name of a region. The available regions are: |
tempo |
The frequency of the data. The available tempos are: |
extraction.dir |
A character string indicating where the extracted and cropped DEM should be put. Defaults to a temporary directory. |
raster.options |
a vector of GDAL options passed to terra::writeRaster. |
force.redo |
If an extraction for this template and label already exists in extraction.dir, should a new one be created? |
progress |
Draw a progress bar when downloading? |
Value
A named list of SpatRaster
s of weather data cropped to the extent of the template.
Examples
## Not run:
# Get the DAYMET (North America only)
# Returns a list of raster bricks
DAYMET <- get_daymet(
template = FedData::meve,
label = "meve",
elements = c("prcp", "tmin", "tmax"),
years = 1980:1985
)
# Plot with terra::plot
plot(DAYMET$tmin$X1985.10.23)
## End(Not run)