Description Usage Arguments Details Value Examples
Extends '[' and '[<-' from the base array class for the Tensor class. Works exactly as it would for the base 'array' class.
1 2 3 4 5 |
x |
Tensor to be subset |
i, j, ... |
indices that specify the extents of the sub-tensor |
drop |
whether or not to reduce the number of modes to exclude those that have '1' as the mode |
value |
either vector, matrix, or array that will replace the subtensor |
x[i,j,...,drop=TRUE]
an object of class Tensor
1 2 3 4 5 6 7 8 9 |
Numeric Tensor of 1 Modes
Modes: 1
Data:
[1] -0.6770678
Numeric Tensor of 1 Modes
Modes: 5
Data:
[1] -0.5950218732 0.0008453985 0.4318944629 0.6538046395 0.5847901444
Numeric Tensor of 2 Modes
Modes: 3 4
Data:
[,1] [,2] [,3] [,4]
[1,] 1.3680175 0.8712612 -0.16440414 1.9616244
[2,] -1.9625257 -0.4597705 -0.14336628 -0.8536279
[3,] 0.5847901 -0.9430118 0.07099026 -1.2856887
Numeric Tensor of 3 Modes
Modes: 3 4 1
Data:
[1] 1.3680175 -1.9625257 0.5847901 0.8712612 -0.4597705 -0.9430118
Numeric Tensor of 1 Modes
Modes: 1
Data:
[1] 3
Numeric Tensor of 1 Modes
Modes: 5
Data:
[1] 0 0 0 0 0
Numeric Tensor of 2 Modes
Modes: 3 5
Data:
[,1] [,2] [,3] [,4] [,5]
[1,] 0 0 0 0 0
[2,] 0 0 0 0 0
[3,] 0 0 0 0 0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.