Description Usage Arguments Value Note See Also Examples
twiddle
automatically creates a GUI for
interactively manipulating variables in an R expression
expr
. This GUI will contrain a control, i.e. a
slider or a checkbox, for every unbound variable in
expr
. expr
is re-evaluated every time the
user changes a control after binding the unbound
variables in expr
to the new settings of their
associated controls. This allows easy interactive
exploration of parameter spaces.
1 2 3 | twiddle(expr, ..., eval = TRUE, auto = TRUE,
label = NULL, envir = parent.frame(),
enclos = if (is.list(envir) || is.pairlist(envir)) parent.frame() else baseenv())
|
expr |
The expression to manipulate through GUI
controls. A control is automatically created for every
variable in |
eval |
If set to |
auto |
If set to |
label |
The text label of twiddler dialog. |
envir |
The environment in which |
enclos |
Relevant when |
... |
Optional configuration information for the
controls for unbound variables in |
The last values of the twiddlers as a named list.
If you use an expr
that generates console output
as a side-effect, e.g. via print
, and you
are running Windows, you might need to use
twiddle_print
to see the output in
realtime.
knob
, combo
,
entry
, filer
, and
toggle
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
twiddle(print(x))
twiddle(print(x), eval = FALSE)
twiddle(print(a && !b), a = toggle(), b = toggle())
twiddle(curve(sin(a * x) + cos(b * x), type = "l", col = "darkblue"),
a = knob(c(0, 0.1), 0.001),
b = knob(c(0, 0.2), 0.001),
auto = FALSE)
twiddle(plot(rnorm(100), type=t), t=combo("p", "l", "b"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.