Perhaps you're a victim of FAQ 7.22. Try putting a print () around your plot
call - e.g., print(histogram(~ dollars)). And please read said FAQ to
understand why...

HTH,
Dennis

On Mon, Nov 22, 2010 at 10:11 PM, Sarah Berry <escalosobre@gmail.com> wrote:

> I ran this script in a source file on my Mac:
>
> library(lattice)
> year <- 1900:2000
> dollars <- (year-1899)^2
> plot(year,dollars)
> quartz("year")
> histogram(~dollars)
>
> The first plot appears in Quartz 2. The second quartz window, named year,
> opens but the histogram doesn't appear.
>
> However, when I copy and paste this script directly into the R console,
> both quartz windows (Quartz 2 and year) open and both plots appear.
>
> As a counter example, the script below run as a source file, works as
> expected, and I get two plots in two windows:
>
> library(lattice)
> year <- 1900:2000
> dollars <- (year-1899)^2
> plot(year,dollars)
> quartz("year")
> plot(year, dollars)
>
> How do I get the lattice package to generate multiple plots in multiple
> windows from a script run from a source file?
>
> Thank you ahead of time,
>
> Sarah B.
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]

