Manipulator Custom State {manipulate}R Documentation

Modify manipulator state

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

manipulatorSetState(name, value)
manipulatorGetState(name)

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

## 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)

[Package manipulate version 1.0.1 Index]