summarise_interpolator {meteoland} | R Documentation |
Summarise interpolator objects by temporal dimension
Description
Summarises an interpolator object by the desired temporal scale.
Usage
summarise_interpolator(
interpolator,
fun = "mean",
frequency = NULL,
vars_to_summary = c("Temperature", "MinTemperature", "MaxTemperature", "Precipitation",
"RelativeHumidity", "MinRelativeHumidity", "MaxRelativeHumidity", "Radiation",
"WindSpeed", "WindDirection", "PET", "SmoothedPrecipitation",
"SmoothedTemperatureRange", "elevation", "slope", "aspect"),
dates_to_summary = NULL,
months_to_summary = 1:12,
verbose = getOption("meteoland_verbosity", TRUE),
...
)
Arguments
interpolator |
An interpolator object as created by |
fun |
The function to use for summarising the data. |
frequency |
A string indicating the interval specification (allowed ones are "week", "month", "quarter" and "year"). If NULL (default), aggregation is done in one interval for all the dates present. |
vars_to_summary |
A character vector with one or more variable names to summarise. By default, all interpolated variables are summarised. |
dates_to_summary |
A Date object to define the dates to be summarised. If NULL (default), all dates in the interpolated data are processed. |
months_to_summary |
A numeric vector with the month numbers to subset
the data before summarising. (e.g. |
verbose |
Logical indicating if the function must show messages and info.
Default value checks |
... |
Arguments needed for |
Value
summarise_interpolator
function returns the same interpolator object provided with the
temporal dimension aggregated to desired frequency.
Author(s)
Víctor Granda García, CREAF
Examples
# example interpolator
meteoland_interpolator_example
# aggregate all dates in the interpolator, calculating the maximum values
summarise_interpolator(meteoland_interpolator_example, fun = "max")
# aggregate weekly, calculating mean values
summarise_interpolator(meteoland_interpolator_example, frequency = "week")