| margin.tensor | R Documentation | 
The function removes dimensions from a tensor by summing all entries which only differ in these dimensions.
margin.tensor(X,i=NULL,by=NULL)
| X | the tensor | 
| i | the dimensions to be removed | 
| by | instead of i the dimensions to be kept | 
This is a tensor multiplication with the 1_i tensor.
The tensor with all elements only differing only in the dimensions specified added up and only the other dimensions left over.
K. Gerald van den Boogaart
to.tensor
A <- diag(1:5)
A
margin.tensor(A,1)
A <- to.tensor(1:30,dim=c(i=3,j=5,k=2))
ftable(A)
margin.tensor(A,"j")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.