| Manipulator Custom State {manipulate} | R Documentation |
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.
manipulatorSetState(name, value) manipulatorGetState(name)
name |
A chraracter string holding a state variable name. |
value |
An object holding a state value. |
manipulatorGetState returns a custom state value which was previously set by manipulatorSetState (or NULL if the specified name is not found).
## 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)