Description Usage Arguments Details Value Author(s) See Also Examples

The diagonal tensor is the tensor equivalent of the diagonal matrix.

1 | ```
diag.tensor(X,mark="'",dn=NULL,by=NULL)
``` |

`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 |

*
E_{i_1...i_n j_1...j_n}=δ_{i_1j_1}...δ_{i_n j_n}
*

a tensor with dimension `c(dim(X),mark(dim(X),mark))`

K. Gerald van den Boogaart

1 2 3 | ```
A <- to.tensor(1:4,c(a=2,b=2))
diag.tensor(A)
diag.tensor(A,by="b")
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.