magclass (version 6.13.2)

dimSums: Summation over dimensions

Description

This function sums over any (sub-)dimension of a magpie object

Usage

dimSums(x, dim = 3, na.rm = FALSE)

Value

A MAgPIE object with values summed over the specified dimensions

Arguments

x

A MAgPIE-object

dim

The dimensions(s) to sum over. A vector of dimension codes or dimension names. See dimCode for more information

na.rm

logical. Should missing values (including NaN) be omitted from the calculations?

Author

Jan Philipp Dietrich

See Also

rowSums, getItems, dimCode

Examples

Run this code
a <- maxample("animal")
dimSums(a, dim = c(1, 2, 3.2))
dimSums(a, dim = c("x", "y", "cell", "month"))

Run the code above in your browser using DataLab