reorder.tensor | R Documentation |
This permutes tensor dimensions like aperm. However the interface is more flexible since not all dimensions have to given and names can be used instead of numbers.
## S3 method for class 'tensor'
reorder(x,i=NULL,...,by=NULL)
x |
the tensor |
i |
numeric or character giving dimensions intended to come first |
... |
further arguments to other instances of the generic function |
by |
the complement of i, if i is not given |
the remaining dimensions keep their relative sequence and follow at the end of the dimension attribute.
reorder.tensor
returns a tensor equal to x but stored with a different
sequence of dimensions.
K.Gerald v.d. Boogaart
to.tensor
A <- to.tensor(1:20,c(A=2,B=2,C=5))
A
reorder(A,"C")
reorder(A,"B")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.