salad | R Documentation |
Set or get options values for package 'salad'
salad(...)
... |
options to be defined, using 'name = value', or name(s) of option(s) to get. |
Currently, only one option can be defined, drop.derivatives
,
which modifies the bevahiour of S3 methods as.vector
and as.matrix
and corresponding S4 methods.
The default value is set to 'TRUE', which means that
as.vector
and as.matrix
will return a 'base' objects, without
derivatives. Setting drop.derivatives = FALSE
will make these functions
return an object of class dual. This might be useful to re-use exiting code,
but may cause some functions to break, and should be use with care.
Use salad()
to get the current value of all options, or
salad(name)
to get the current value of a given option.
A list with the defined options, or a single element when salad(name)
is used.
salad("drop.derivatives")
x <- dual(matrix(c(1,2,3,4), 2, 2))
salad(drop.derivatives = FALSE)
as.vector(x)
salad(drop.derivatives = TRUE)
as.vector(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.