summarise_interpolated_data {meteoland} | R Documentation |
Summarise interpolated data by temporal dimension
Description
Summarises the interpolated meteorology in one or more locations by the desired temporal scale
Usage
summarise_interpolated_data(
interpolated_data,
fun = "mean",
frequency = NULL,
vars_to_summary = c("MeanTemperature", "MinTemperature", "MaxTemperature",
"Precipitation", "MeanRelativeHumidity", "MinRelativeHumidity",
"MaxRelativeHumidity", "Radiation", "WindSpeed", "WindDirection", "PET"),
dates_to_summary = NULL,
months_to_summary = 1:12,
verbose = getOption("meteoland_verbosity", TRUE),
...
)
Arguments
interpolated_data |
An interpolated data object as returned 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 |
Details
If interpolated_data
is a nested interpolated data sf object, as
returned by interpolate_data
, temporal summary is done for each
location present in the interpolated data. If interpolated_data
is
an unnested interpolated data sf object, temporal summary is done for all
locations together. If interpolated_data
is a single location data.frame
containing the dates and the interpolated variables, temporal summary is done
for that location. If interpolated_data
is a stars object as returned
by interpolate_data
, temporal summary is done for all the raster.
Value
For a nested interpolated data, the same sf object with a new column with the temporal summaries. For an unnested interpolated data, a data.frame with the summarised meteo variables. For an interpolated raster (stars object), the same raster with the temporal dimension aggregated as desired.
Author(s)
Víctor Granda García, CREAF
Examples
# points interpolation aggregation
points_to_interpolate_example |>
interpolate_data(meteoland_interpolator_example, verbose = FALSE) |>
summarise_interpolated_data()
# raster interpolation aggregation
raster_to_interpolate_example |>
interpolate_data(meteoland_interpolator_example, verbose = FALSE) |>
summarise_interpolated_data()