matrix | R Documentation |
Methods for 'matrix', 'array', 'as.matrix' and 'as.vector'
## S4 method for signature 'dual'
matrix(data = NA, nrow = 1, ncol = 1, byrow = FALSE, dimnames = NULL)
## S4 method for signature 'dual'
array(data = NA, dim = length(data), dimnames = NULL)
## S3 method for class 'dual'
as.matrix(x, ...)
## S4 method for signature 'dual'
as.matrix(x, ...)
## S3 method for class 'dual'
as.vector(x, mode = "any")
## S4 method for signature 'dual'
as.vector(x, mode = "any")
data , x |
A dual object |
nrow |
the desired number of rows |
ncol |
the desired number of cols |
byrow |
if 'TRUE' the matrix is filled by rows |
dimnames |
A 'dimnames' attributes for a matrix or an array |
dim |
A 'dim' attributes for an array |
... |
additional arguments (ignored) |
mode |
The mode of the vector to create |
The default behaviour for 'as.matrix' dans 'as.vector' is to drop the derivatives. This can be modified using 'salad' (to use with care). The prefered method to change the shape is to use 'dim<-'.
A dual object for 'matrix' and 'array', a base object for 'as.matrix' and 'as.vector'.
shape, salad
, dual-class
x <- dual(c(1,2,0,4))
y <- matrix(x, 2, 2)
y
as.matrix(y)
dim(x) <- c(2,2)
x
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.