diag-methods | R Documentation |
Extract or replace the diagonal of a DelayedArray, or substitute the elements to the diagonal DelayedArray.
diag(darr) diag(darr) <- value ## S4 method for signature 'DelayedArray' diag(darr) ## S4 replacement method for signature 'DelayedArray' diag(darr) <- value
darr |
DelayedArray object |
value |
either a single value or a vector of length equal to that
of the current diagonal. Should be of a mode which can be coerced
to that of |
See also DelayedDiagonalArray
or diag
.
1D DelayedArray (vector) with length min(dim(darr))
T. Kolda, B. Bader, "Tensor decomposition and applications". SIAM Applied Mathematics and Applications 2009.
DelayedDiagonalArray
library("DelayedRandomArray") darr <- RandomUnifArray(c(2,3,4)) DelayedTensor::diag(darr) DelayedTensor::diag(darr)[1] <- 11111 DelayedTensor::diag(darr)[2] <- 22222 DelayedTensor::diag(darr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.