dimOrder {magclass} | R Documentation |
dimOrder
Description
Changes the order of the sub-dimension in a magpie object similar to unwrapping and applying the aperm command, but more efficient.
Usage
dimOrder(x, perm, dim = 3)
Arguments
x |
magpie object |
perm |
vector with the new order of the sub-dimension. Missing sub-dimensions will added automatically at the end |
dim |
main dimension in which the order of sub-dimensions should be changed (1, 2 or 3) |
Value
magpie object
Author(s)
Jan Philipp Dietrich, Benjamin Leon Bodirsky
Examples
a <- maxample("animal")
head(a)
head(dimOrder(a, perm = 3:1, dim = 1))
head(dimOrder(a, perm = c(2,1,3), dim = 3))
[Package magclass version 6.13.2 Index]