dimSums: Summation over dimensions

View source: R/dimSums.R

dimSumsR Documentation

Summation over dimensions

Description

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

Usage

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

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?

Value

A MAgPIE object with values summed over the specified dimensions

Author(s)

Jan Philipp Dietrich

See Also

rowSums, getItems, dimCode

Examples

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

magclass documentation built on July 9, 2023, 7:03 p.m.