Multiple groupedData plots in a postscript file using a loop
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
print(plot(Loblolly))
(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