state: Modify manipulator state

Description Usage Arguments Value See Also Examples

Description

These functions allow the storage of custom state variables across multiple evaluations of manipulator expressions. These functions are useful if the manipulate expression is a custom function (rather than a high level plotting function like plot) which requires reading and writing of persistent values.

Usage

1
2

Arguments

name

A chraracter string holding a state variable name.

value

An object holding a state value.

Value

manipulatorGetState returns a custom state value which was previously set by manipulatorSetState (or NULL if the specified name is not found).

See Also

manipulate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 

## set custom state variable
manipulatorSetState("last", x)

## get custom state variable
last <- manipulatorGetState("last")
if ( !is.null(last) ) {
  # do something interesting
}


## End(Not run)

manipulate documentation built on May 2, 2019, 3:27 a.m.