untensor | R Documentation |
untensor is more or less the inverse of to.tensor. It flattens tensorial dimensions. However the result is still a tensor.
untensor(X,i=NULL,name=NULL,pos=1,by=NULL)
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 |
The dimensions to be removed are gathered and
a tensor with the dimensions i removed.
K.Gerald van den Boogaart
to.tensor
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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.