Skip to content

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.

Usage

# S3 method for class 'magpie'
aperm(a, perm = NULL, ...)

Arguments

a

A magpie object.

perm

An integer vector giving the new permutation of dimensions, or NULL for reverse order. See aperm.

...

Further parameters passed on to aperm.

Value

A plain array (magpie class attribute dropped).

Details

Use dimOrder to reorder sub-dimensions within a single main dimension while preserving the magpie class.

Author

Patrick Rein

Examples

p <- maxample("pop")
a <- aperm(p, c(2, 1, 3))
class(a) # "array", not "magpie"
#> [1] "array"