powered by
Methods extending to dual objects the corresponding methods for numeric objects.
diag.dual(x, nrow, ncol, names = TRUE)# S4 method for dual diag(x = 1, nrow, ncol, names = TRUE)# S4 method for dual,dual diag(x) <- value# S4 method for dual,numericOrArray diag(x) <- value
# S4 method for dual diag(x = 1, nrow, ncol, names = TRUE)
# S4 method for dual,dual diag(x) <- value
# S4 method for dual,numericOrArray diag(x) <- value
A dual object, similarly to `base::diag`
a dual object
(optional) dimensions of result
if 'TRUE', pass names along
replacement value
x <- dual( c(1,2) ) diag(x) d(diag(x), "x1") y <- matrix(x, 2, 2) diag(y) <- 2*diag(y) y d(y) diag(y)
Run the code above in your browser using DataLab