| aperm.magpie | R Documentation |
Permutes the dimensions of a magpie object and returns a plain array. Since the magpie class has fixed dimension semantics (spatial, temporal, data), permuting the main dimensions produces an object that is no longer a valid magpie. This method therefore always returns a plain array.
## S3 method for class 'magpie'
aperm(a, perm = NULL, ...)
a |
A magpie object. |
perm |
An integer vector giving the new permutation of dimensions,
or NULL for reverse order. See |
... |
Further parameters passed on to |
Use dimOrder to reorder sub-dimensions within a single main
dimension while preserving the magpie class.
A plain array (magpie class attribute dropped).
Patrick Rein
dimOrder, aperm
p <- maxample("pop")
a <- aperm(p, c(2, 1, 3))
class(a) # "array", not "magpie"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.