[R] again troubles with lattice

Wladimir Eremeev wl at eimb.ru
Thu May 8 10:54:28 CEST 2003


Dear r-help community,

  Thank you for your previous answers!
  
  Now I have strange behaviour of the lattice library funcitons.
  They do not draw graphics in the file when called from the script.
  I created the script file, called, for example, "a.R", containing
  the following
  
library(lattice);
trellis.device(device="png",
               filename="a.png",
               color = FALSE,
               bg = "white",
               width=600,
               height=800
              );

xyplot(ac15$value~ac15$year|factor(lon),data=ac15,
       type="o",
       layout=c(1,18),
       xlab="year",
       );
dev.off();


The structure of ac15 data frame is like following
year    value    lon
1979  93.428747  0
1979  87.298608  20
1979  78.506340  40
...
1979  45.567890  340
1980  60.815289  0
1980  49.630904  20
1980  24.981362  40
...

I execute command source("a.R") it works and after its running I've
got file a.png in the working directory. But it contains only white
background field and no graphs.

If I try copy commands of the script in clipboard and paste them to
the R console the graphs appear in the file.

-- 
Best regards
Wladimir Eremeev                                     mailto:wl at eimb.ru




More information about the R-help mailing list