# NOT RUN {
data.plotfn <- function(panel) {
if (panel$plot.type == "histogram")
hist(panel$x)
else
if (panel$plot.type == "boxplot")
boxplot(panel$x)
else
plot(density(panel$x))
panel
}
panel <- rp.control(x = rnorm(50))
rp.listbox(panel, plot.type,
c("histogram", "boxplot", "density estimate"),
action = data.plotfn, title = "Plot type")
# }
Run the code above in your browser using DataLab