[R] Lattice and Quartz

David Winsemius dwinsemius at comcast.net
Tue Nov 23 14:53:53 CET 2010


On Nov 23, 2010, at 1:11 AM, Sarah Berry 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.

Unable to reproduce on my mac using 64 bit GUI. Both plots appears in  
separate windows.

 > sessionInfo()
R version 2.12.0 (2010-10-15)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

>
> 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]]


David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list