summarise_interpolator: Summarise interpolator objects by temporal dimension

View source: R/tidy_summary_interpolated_data.R

summarise_interpolatorR Documentation

Summarise interpolator objects by temporal dimension

Description

[Experimental]

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 create_meteo_interpolator.

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. c(7,8) for July and August). This parameter allows studying particular seasons, when combined with frequency. For example frequency = "years" and months = 6:8 leads to summarizing summer months of each year.

verbose

Logical indicating if the function must show messages and info. Default value checks "meteoland_verbosity" option and if not set, defaults to TRUE. It can be turned off for the function with FALSE, or session wide with options(meteoland_verbosity = FALSE)

...

Arguments needed for fun

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")




meteoland documentation built on Aug. 21, 2023, 5:10 p.m.