diag | R Documentation |
Methods extending to dual objects the corresponding methods for numeric objects.
diag.dual(x, nrow, ncol, names = TRUE)
## S4 method for signature 'dual'
diag(x = 1, nrow, ncol, names = TRUE)
## S4 replacement method for signature 'dual,dual'
diag(x) <- value
## S4 replacement method for signature 'dual,numericOrArray'
diag(x) <- value
x |
a dual object |
nrow , ncol |
(optional) dimensions of result |
names |
if 'TRUE', pass names along |
value |
replacement value |
A dual object, similarly to 'base::diag'
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.