mcalc: mcalc

View source: R/mcalc.R

mcalcR Documentation

mcalc

Description

Select values from a MAgPIE-object

Usage

mcalc(x, f, dim = NULL, append = FALSE)

Arguments

x

MAgPIE object

f

A formula describing the calculation that should be performed

dim

The dimension in which the manipulation should take place. If set to NULL function tries to detect the dimension automatically.

append

If set to TRUE the result will be appended to x, otherwise the result will be returned.

Details

This functions only work for MAgPIE objects with named dimensions as the dimension name (set_name) has to be used to indicate in which dimension the entries should be searched for!

Value

The calculated MAgPIE object in the case that append is set to FALSE. Otherwise nothing is returned (as x is appended in place)

Author(s)

Jan Philipp Dietrich

See Also

mselect

Examples


pop <- maxample("pop")
pop
mcalc(pop, X12 ~ A2 * B1, append = TRUE)
pop
mcalc(pop, `Nearly B1` ~ 0.5 * A2 + 99.5 * B1)

magclass documentation built on May 29, 2024, 6:20 a.m.