Learn R Programming

listarrays (version 0.3.1)

t.array: transpose an array

Description

transpose an array

Usage

# S3 method for array
t(x)

Arguments

x

an array

This reverses the dimensions of an array

Examples

Run this code
# NOT RUN {
x <- array(1:27, c(3,3,3))
tx <- t(x)
for (i in 1:3)
  for(j in 1:3)
    stopifnot(x[,j,i] == tx[i,j,])
# }

Run the code above in your browser using DataLab