[R] lattice.device in loop

From: Matt Pocernich <pocernic_at_rap.ucar.edu>
Date: Wed 28 Jul 2004 - 02:30:40 EST


Hi,

I am having problems creating a pdf file of a lattice graph. Things work fine for a single image, but I am having trouble using the commands in a loop. To illustrate by example

This works with both ps and pdf files.

dat = list(x= 1:10, y = 1:10)
 trellis.device(postscript, file = "/d1/pocernic/test.ps")

    xyplot(y~x, data = dat)
dev.off()

This does not. It produces a very small, non working output file.

for(i in 1:1){
 trellis.device(postscript, file = "/d1/pocernic/test.ps")

    xyplot(y~x, data = dat)
dev.off()
}

Really, I would like something like this to produce a large, appended file made from different large datasets. This doesn't work either.

trellis.device(postscript, file = "/d1/pocernic/test.ps", onefile = TRUE) for(i in 1:5){

    xyplot(y~x, data = dat)
}

dev.off()

Any thoughts would be welcomed.

Matt Pocernich
NCAR - Research Applications Program
303-497-8312



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jul 28 02:37:42 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 02:39:50 EST