aggregateVALUE: Aggregation of value objects along selected dimensions

View source: R/aggregateVALUE.R

aggregateVALUER Documentation

Aggregation of value objects along selected dimensions

Description

Aggregates a grid along the target dimensions through aggregation function specification.

Usage

aggregateVALUE(valueObj, aggr.m = list(FUN = "mean", na.rm = TRUE))

Arguments

valueObj

A VALUE object to be aggregated.

aggr.m

Monthly aggregation function. A list indicating the name of the aggregation function in first place, and other optional arguments to be passed to the aggregation function. See the examples.

Details

Currently only the temporal monthly aggregation is implemented

Value

A VALUE object aggregated along the chosen dimension(s).

Author(s)

J. Bedia

Examples


obs.file <- file.path(find.package("R.VALUE"),
                      "example_datasets",
                      "VALUE_ECA_86_v2.zip")
tmin.DJF.daily <- loadValueStations(obs.file, "tmin",
                                    season = c(12,1,2), years = 1970:2008)
# Monthly means:
tmin.DJF.monthlyMean <- aggregateVALUE(tmin.DJF.daily, aggr.m = list(FUN = "mean", na.rm = TRUE))
# Other functions can be introduced by the user. E.g., monthly median:
tmin.DJF.monthlyMedian <- aggregateVALUE(tmin.DJF.daily,
                                       aggr.m = list(FUN = "quantile", probs = .5, na.rm = TRUE))

SantanderMetGroup/R_VALUE documentation built on July 4, 2023, 4:27 a.m.