Construct a dtensor from a multi-dimensional array.
dtensor(x) # S4 method for array dtensor(x) # S4 method for numeric dtensor(x)
x | n-dimensional R array |
---|
dtensor-class
for class documentation.
# A 2x2x2 dense tensor arr <- array(data = c(1,0,0,0,1,0,0,0) , dim = c(2,2,2)) X <- dtensor(arr)