Learn R Programming

dMod (version 0.3.1)

controls: List, get and set controls for different functions

Description

Applies to objects of class objfn, parfn, prdfn and obsfn. Allows to manipulate different arguments that have been set when creating the objects.

Usage

controls(x, ...)
"controls"(x, name = NULL, ...)
"controls"(x, condition = NULL, name = NULL, ...)
controls(x, ...) <- value
"controls"(x, name, ...) <- value
"controls"(x, condition = NULL, name, ...) <- value

Arguments

x
function
...
arguments going to the appropriate S3 methods
name
character, the name of the control
condition
character, the condition name
value
the new value

Value

Either a print-out or the values of the control.

Details

If called without further arguments, controls(x) lists the available controls within an object. Calling controls() with name and condition returns the control value. The value can be overwritten. If a list or data.frame ist returned, elements of those can be manipulated by the $- or []-operator.

Examples

Run this code
## parfn with condition
p <- P(eqnvec(x = "-a*x"), method = "implicit", condition = "C1")
controls(p)
controls(p, "C1", "keep.root")
controls(p, "C1", "keep.root") <- FALSE

## obsfn with NULL condition
g <- Y(g = eqnvec(y = "s*x"), f = NULL, states = "x", parameters = "s")
controls(g)
controls(g, NULL, "attach.input")
controls(g, NULL, "attach.input") <- FALSE 

Run the code above in your browser using DataLab