button {manipulate} | R Documentation |
Create a button control to enable triggering of conditional actions within manipulate expressions. When the user presses the button the manipulate expression will be executed with its associated value set to TRUE (in all other cases the value will be set to FALSE).
button(label)
label |
Label for button. |
An object of class "manipulator.button" which can be passed to the manipulate
function.
manipulate
, slider
, picker
, checkbox
## Not run: ## use a button to reset a random seed manipulate( { if(resetSeed) set.seed(sample(1:1000)) hist(rnorm(n=100, mean=0, sd=3), breaks=bins) }, bins = slider(1, 20, step=1, initial =5, label="Bins"), resetSeed = button("Reset Seed") ) ## End(Not run)