magclass (version 6.13.2)

dimReduce: dimReduce

Description

Remove dimensions which contain identical data for all elements in it

Usage

dimReduce(x, dim_exclude = NULL)

Value

The reduced MAgPIE object

Arguments

x

MAgPIE object which should be reduced

dim_exclude

Vector with names of dimensions which must not be reduced

Author

Jan Philipp Dietrich

See Also

add_dimension

Examples

Run this code

# 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))

Run the code above in your browser using DataLab