dimReduce | R Documentation |
Remove dimensions which contain identical data for all elements in it
dimReduce(x, dim_exclude = NULL)
x |
MAgPIE object which should be reduced |
dim_exclude |
Vector with names of dimensions which must not be reduced |
The reduced MAgPIE object
This function has some similarities to collapseDim
, but
serves a different purpose. While collapseDim
only removes
dimensions which contain only a single element or which it is
specifically told to remove, dimReduce
looks whether the
entries of a multi-entry dimension are all the same and removes dimensions
for which this is the case. In some cases both will lead to the same result
but in many other cases the results will differ.
Jan Philipp Dietrich
add_dimension
# create data with 5 identical scenarios
p <- add_dimension(maxample("pop")[1:3, 1:3, ], nm = paste0("scen", 1:2))
str(p)
str(dimReduce(p))
# set years to same value
p[, , ] <- setYears(p[, 1, ], NULL)
str(p)
str(dimReduce(p))
# set regions to same value
p[, , ] <- setCells(p[1, , ], "GLO")
str(p)
str(dimReduce(p))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.