In this example, we are going to have a regular HTML document
with an <Rdevice> tag that is equivalent to an OBJECT
type="x-app/x-Rdevice" component. The idea is that we will
replace that node in the document with an actual R graphics device and
make that the active device. Then, all plots will subsequently be
drawn on that (until another device is created in the R session).
We add a button so that we can test updating the plots.
(Note that we put the code for the callback in the contents of the
HTML node and not hard-code it into the R function. This makes it easy
to change.)
hist(rnorm(100), main = "Sample of 100 from a Normal distribution")
Next, we put two devices into a table.
hist(rnorm(100), main = "Sample of 100 from a Normal distribution")
boxplot(rnorm(100), main = "Sample of 100 from a Normal distribution")
We should have a mechanism to get all the components in the HTML page
from within the handler code and callbacks. We've done that in the
past for dynamic documents so we need to revisit that framework.
Duncan Temple Lang<duncan@wald.ucdavis.edu>
Last modified: Mon Nov 27 10:31:36 PST 2006