Transpose a 'listenv' array by permuting its dimensions

# S3 method for listenv
aperm(a, perm, ...)

# S3 method for listenv
t(x)

Arguments

a, x

(listenv) The list environment to be transposed

perm

(integer vector) An index vector of length dim(a)

...

Additional arguments passed to base::aperm().

Value

Returns a list environment with permuted dimensions

See also

These functions works like base::aperm() and base::t().

Examples

x <- as.listenv(1:6)
dim(x) <- c(2, 3)
dimnames(x) <- list(letters[1:2], LETTERS[1:3])
print(x)
#> A ‘listenv’ matrix with 6 elements (unnamed) arranged in 2x3 rows (‘a’, ‘b’) and columns (‘A’, ‘B’, ‘C’).

x <- t(x)
print(x)
#> A ‘listenv’ matrix with 6 elements (unnamed) arranged in 3x2 rows (‘A’, ‘B’, ‘C’) and columns (‘a’, ‘b’).

x <- aperm(x, perm = 2:1)
print(x)
#> A ‘listenv’ matrix with 6 elements (unnamed) arranged in 2x3 rows (‘a’, ‘b’) and columns (‘A’, ‘B’, ‘C’).