From bates at stat.wisc.edu  Fri Jun 20 00:03:33 2003
From: bates at stat.wisc.edu (Douglas Bates)
Date: Fri Jun 20 01:03:35 2003
Subject: [Rd] lattice and Sweave
In-Reply-To: <Pine.A41.4.44.0306191128490.97770-100000@homer37.u.washington.edu>
References: <Pine.A41.4.44.0306191128490.97770-100000@homer37.u.washington.edu>
Message-ID: <6r65n1656p.fsf@bates4.stat.wisc.edu>

Thomas Lumley <tlumley@u.washington.edu> writes:

> I'm having trouble using lattice and Sweave together.
> 
> An example of the trouble is the chunk
> 
> <<fig=true, eps=false>>=
> library(nlme)
> data(Orthodont)
> plot(Orthodont)
> @

I have a big sign next to my monitor saying 

 When using Sweave you _must_ print a lattice plot.

because I have made this mistake so many times.  In my rush to finish
the slides for a short course that I am teaching today and tomorrow I
forgot this and contacted Deepayan, who is travelling in India right
now, in a panic. He calmly told me "you forgot to print".

It will work if you use

 print(plot(Orthodont))


[Rd] lattice and Sweave
Douglas Bates