List, get and set controls for different functions

Share:

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
controls(x, ...)

## S3 method for class 'objfn'
controls(x, name = NULL, ...)

## S3 method for class 'fn'
controls(x, condition = NULL, name = NULL, ...)

controls(x, ...) <- value

## S3 replacement method for class 'objfn'
controls(x, name, ...) <- value

## S3 replacement method for class 'fn'
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

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.

Value

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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 

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.