[R] rpanel package - retrieve data from panel

michalseneca michalseneca at gmail.com
Tue Nov 8 19:14:10 CET 2011


Dear  Co-Forumeees

Does anybody have experience with using rpanel..or how to retrieve data from
created panel.

For example my panel draws some interactive graph and computes something
inside the panel.

Question : is there a way to retrieve those data ?

For illustration:


if (interactive()) {
   plot.hist <- function(panel) {
	 with(panel, {
		xlim <- range(c(x, mean(x) + c(-3, 3) * sd(x)))
	   if (panel$cbox[3])
	      clr <- "lightblue" else clr <- NULL
	   hist(x, freq = FALSE, col = clr, xlim = xlim)
           y<-x+2
	   if (panel$cbox[1]) {
	      xgrid <- seq(xlim[1], xlim[2], length = 50)
	      dgrid <- dnorm(xgrid, mean(x), sd(x))
	      lines(xgrid, dgrid, col = "red", lwd = 3)
	      }
	   if (panel$cbox[2])
	      box()
	   })
	 panel
	 }
   x <- rnorm(50)
   panel <- rp.control(x = x)
   rp.checkbox(panel, cbox, plot.hist, 
      labels = c("normal density", "box", "shading"), title = "Options")
   rp.do(panel, plot.hist)
   }

and I want to retrieve y in my further computations outside the panel.

Thanks and regards

Mike

--
View this message in context: http://r.789695.n4.nabble.com/rpanel-package-retrieve-data-from-panel-tp4016953p4016953.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list