library(lattice)
## generate an xyplot, write it to file, and return HTML
## code that sources the generated image
dat <- data.frame( x = rnorm(100), y = rnorm(100) )
hImg( file = "plot_output.png",
xyplot( y ~ x, dat )
)
Run the code above in your browser using DataLab