untensor {tensorA} | R Documentation |
Removes indices/dimensions from a tensor
Description
untensor is more or less the inverse of to.tensor. It flattens tensorial dimensions. However the result is still a tensor.
Usage
untensor(X,i=NULL,name=NULL,pos=1,by=NULL)
Arguments
X |
the tensor |
i |
the names of the dimensions to be removed and combined to a
single new
one as a character vector or a named list of character vectors if
the remove should be done in multiple chunks.
|
name |
the name of the new dimension to replace the others |
pos |
where to insert the the new dimension |
by |
if i not given the dimensions to be kept |
Details
The dimensions to be removed are gathered and
Value
a tensor with the dimensions i removed.
Author(s)
K.Gerald van den Boogaart
See Also
Examples
A <- to.tensor(1:64,c(a=2,b=2,c=2,d=2,e=2,f=2))
untensor(A,list(c(1,5),c(2,4)),name=c("i","j"))
untensor(A,by=c("c","f"))
untensor(A,c("a","d"))
[Package tensorA version 0.36.2.1 Index]