salad {salad}R Documentation

Salad options

Description

Set or get options values for package 'salad'

Usage

salad(...)

Arguments

...

options to be defined, using 'name = value', or name(s) of option(s) to get.

Details

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.

Value

A list with the defined options, or a single element when salad(name) is used.

Examples

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)

[Package salad version 1.0 Index]