Select values from a MAgPIE-object
mcalc(x, f, dim = NULL, append = FALSE)
MAgPIE object
A formula describing the calculation that should be performed
The dimension in which the manipulation should take place. If set to NULL function tries to detect the dimension automatically.
If set to TRUE the result will be appended to x, otherwise the result will be returned.
The calculated MAgPIE object in the case that append is set to FALSE. Otherwise nothing is returned (as x is appended in place)
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!
# NOT RUN {
data(population_magpie)
population_magpie
mcalc(population_magpie,X12 ~ A2*B1,append=TRUE)
population_magpie
mcalc(population_magpie,`Nearly B1` ~ 0.5*A2 + 99.5*B1)
# }
Run the code above in your browser using DataLab