Changes the order of the sub-dimension in a magpie object similar to unwrapping and applying the aperm command, but more efficient.
dimOrder(x, perm, dim = 3)
magpie object
vector with the new order of the sub-dimension. Missing sub-dimensions will added automatically at the end
main dimension in which the order of sub-dimensions should be changed (1, 2 or 3)
Jan Philipp Dietrich, Benjamin Leon Bodirsky
a <- maxample("animal") head(a) head(dimOrder(a, perm = 3:1, dim = 1)) head(dimOrder(a, perm = c(2,1,3), dim = 3))
Run the code above in your browser using DataLab