[R] plot via xyplot not being saved

deepayan.sarkar at gmail.com deepayan.sarkar at gmail.com
Sat Jun 16 02:53:27 CEST 2007


On 6/15/07, Benilton Carvalho <bcarvalh at jhsph.edu> wrote:
> Hi everyone,
>
> it's been a while I've been trying to save a plot created via
> lattice:::xyplot
>
> if I have a file tst.R with the following code:
>
> y <- rnorm(100)
> x <- rnorm(100)
> z <- sample(letters[1:4], 100, rep=T)
> library(lattice)
> bitmap("tst.png")
> xyplot(y~x|z)
> dev.off()
>
> and I source it, I get the tst.png file, which is a blank page.
>
> If I copy and paste instead, I get the correct plot.
>
> Any suggestion?

Use

source(..., echo = TRUE)

-Deepayan



More information about the R-help mailing list