Last chance! 50% off unlimited learning
Sale ends in
hImg(my_plot, file, width = 400, height = 300, dpi = 300, dim = NULL, scale = 100, device = "png", ...)
par( mfrow )
; used if making
multiple base-R plotspng
dim
attribute is passed on to par(
mfrow='dim' )
; ie, it is used if you are calling a plot
function that writes more than one plot.The png
device is used.
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