View source: R/daymet_grid_agg.r
daymet_grid_agg | R Documentation |
Aggregates daily Daymet data by time interval to create convenient seasonal datasets for data exploration or modelling.
daymet_grid_agg(
file,
int = "seasonal",
fun = "mean",
internal = FALSE,
path = tempdir()
)
file |
The name of the file to be processed. Use daily gridded Daymet data. |
int |
Interval to aggregate by. Options are "monthly", "seasonal" or "annual". Seasons are defined as the astronomical seasons between solstices and equinoxes (default = "seasonal") |
fun |
Function to be used to aggregate data. Genertic R functions can be used. "mean" and "sum" are suggested. na.rm = TRUE by default. (default = "mean") |
internal |
logical If FALSE, write the output to a tif file using the Daymet file format protocol. |
path |
path to a directory where output files should be written. Used only if internal = FALSE (default = tempdir()) |
aggregated daily Daymet data as a tiff file written to disk or a raster stack when data is returned to the workspace.
## Not run:
# This code calculates the average minimum temperature by
# season for a subset region.
# download default ncss tiled subset for 1980
# (daily tmin values only), works on tiles as well
download_daymet_ncss()
# Finally, run the function
daymet_grid_agg(
file = file.path(tempdir(),"/tmin_daily_1980_ncss.nc"),
int = "seasonal",
fun = "mean"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.