diag.tensor {tensorA} | R Documentation |
Creates a "diagonal" tensor
Description
The diagonal tensor is the tensor equivalent of the diagonal matrix.
Usage
diag.tensor(X,mark="'",dn=NULL,by=NULL)
Arguments
X |
a tensor containing the diagonal entries. |
mark |
a character to be concatenated to the names of the row dimensions to get the column dimension names |
dn |
dimnames which are used twice |
by |
The diagonal tensor is created for each level of the indices
in |
Details
Value
a tensor with dimension c(dim(X),mark(dim(X),mark))
Author(s)
K. Gerald van den Boogaart
See Also
Examples
A <- to.tensor(1:4,c(a=2,b=2))
diag.tensor(A)
diag.tensor(A,by="b")
[Package tensorA version 0.36.2.1 Index]