# NOT RUN {
hist.or.boxp <- function(panel) {
if (panel$plot.type == "histogram")
hist(panel$x)
else
boxplot(panel$x)
panel
}
panel <- rp.control(x=rnorm(50), panelname="panel")
rp.radiogroup(panel, plot.type, c("histogram", "boxplot"),
title="Plot type", action = hist.or.boxp)
# Try also
# panel <- rp.control()
# rp.control.dispose(panel)
# }
Run the code above in your browser using DataCamp Workspace