[R] lattice graphics empty in Sweave

Thomas Petzoldt thpe at hhbio.wasser.tu-dresden.de
Fri Dec 10 10:41:31 CET 2004


Hello,

I have problems using lattice graphics together with Sweave under 
Windows XP and R 2.0.0; 2.0.1 Patched; 2.1.0 devel respectively.
Base graphics are o.k., but for lattice graphics empty files (.eps and 
.pdf) are generated.

The only workaround I found was to write and read the respective figures 
explicitely using postscript() and includegraphics{}.

Have I missed something to solve this in the canonical way?

Thomas P.

A minimal example:


=== lattice.Rnw======================================================
\documentclass[a4paper, dvips]{article}
\begin{document}

<<fig=TRUE>>=
   library(lattice)
   data(iris)
   xyplot(Sepal.Length~Sepal.Width|Species, data=iris)
@

\end{document}
=====================================================================


in R:

 > Stangle("lattice.Rnw")
 > Sweave("lattice.Rnw")
 > system("latex lattice")
 > system("dvips lattice")




More information about the R-help mailing list