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")
Fernando Henrique Ferraz P. da Rosa
2004-Dec-10 10:09 UTC
[R] lattice graphics empty in Sweave
Thomas Petzoldt writes:> === lattice.Rnw=====================================================> \documentclass[a4paper, dvips]{article} > \begin{document} > > <<fig=TRUE>>> library(lattice) > data(iris) > xyplot(Sepal.Length~Sepal.Width|Species, data=iris) > @ > > \end{document} > ====================================================================>This is addressed in Sweave's and R's FAQ. ci.tuwien.ac.at/~leisch/Sweave/FAQ.html#x1-8000A.6 cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f -- Fernando Henrique Ferraz P. da Rosa ime.usp.br/~feferraz