[R] Multiple groupedData plots in a postscript file using a loop

Deepayan Sarkar deepayan at stat.wisc.edu
Sat Jan 17 16:32:07 CET 2004

On Saturday 17 January 2004 08:58, Karl Knoblick wrote:
> Hallo!
> I want to plot multiple grouped data in a postscript
> file using a loop. As I use a loop no plot (or just
> one empty plot) is generated. Here an example:
> library(nlme)
> data(Loblolly) # example data from nlme
> postscript("PSFile.ps")
> for (i in 1:1) # just as example
> {
> 	plot(Loblolly)

replace this line with 


(plot(Loblolly) produces a ``trellis'' object, which needs to be 'print'-ed 
for anything to be actually plotted. Inside a loop (or a function), this does 
not happen unless you call print() explicitly)

> }
> dev.off()
> Result: Just an empty PSFile.ps.
> (Withoput the loop it works.
> May anybody help?
> Karl

More information about the R-help mailing list