arev {magic} | R Documentation |
A multidimensional generalization of rev()
: given an array
a
, and a Boolean vector swap
, return an array of the
same shape as a
but with dimensions corresponding to TRUE
elements of swap
reversed.
arev(a, swap = TRUE)
a |
Array to be reversed |
swap |
Vector of Boolean variables. If swap[i] is
TRUE , then dimension i of array a is reversed.
If swap is of length one, recycle to length(dim(a)) . |
Robin K. S. Hankin
a <- matrix(1:42,6,7) arev(a) #Note swap defaults to TRUE b <- magichypercube.4n(1,d=4) arev(b,c(TRUE,FALSE,TRUE,FALSE))