demo/rp.slider.r

density.draw <- function(panel) 
{
  print(panel$h[1])
  print(panel$h[2])
  plot(density(as.numeric(panel$x), bw=panel$h[1]*panel$h[2]))
  panel
}

panel <- rp.control(x=rnorm(50))
rp.slider(panel, h, c(0.1, 0.01), c(5, 1), title=c("Log", "Linear"), initval=c(2, 1), log=c(TRUE, FALSE), showvalue=TRUE, action=density.draw)

Try the rpanel package in your browser

Any scripts or data that you put into this service are public.

rpanel documentation built on Feb. 16, 2023, 10:37 p.m.