Is there a way to extract current value from a slider control in manipulate package? For example:
library(manipulate)
xx <- seq(-pi, pi, pi/20)
manipulate(
plot(xx, sin(par.a*xx)),
par.a = slider(-3, 3, step=0.01, initial = 1))
After playing with the slider I would like to get the value of par.a
for further calculations without having to look at the control and write it by hand each time.
Figured it out myself.
It is possible to do with global variables
manipulate(
{plot(xx, sin(par.a*xx))
a <<- par.a},
par.a = slider(-3, 3, step=0.01, initial = 1))
Maybe it will be of assistance to somebody.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With