[R-sig-eco] Command pch in lattice package

Manuel Spínola mspinola at una.ac.cr
Thu Jul 10 18:26:36 CEST 2008


Dear list members,

I am  elaborating a graphic with  the lattice package:

library(lattice)
data(barley)
barley
dotplot(variety ~ yield | site, data = barley, group = year, pch=c(1, 
3), col=c("red", "blue"),


Here are the 3 first and the 3 last rows for the data set:

      yield               variety           year             site
1   27.00000        Manchuria     1931    University Farm
2   48.86667        Manchuria     1931                Waseca
.
.
.
.
118 35.90000  Wisconsin No. 38  1932         Crookston
119 20.66667  Wisconsin No. 38  1932    Grand Rapids
120 29.33333  Wisconsin No. 38  1932               Duluth

When I specify the pch=c(1, 3), which are a "dot" and a "+" character, 
the "dot" is assigned to the year 1932 (that appear after year 1931) and 
the "+" is assigned to the year 1931 (that appear first in the data 
frame).  Why is that? I though R should assign the first character in 
the vector (pch= c(1, 3)) to the first level in the grouping  variable 
(year).
Thank you very much in advance.
Best,

Manuel Spínola

-- 
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspinola at una.ac.cr
mspinola10 at gmail.com
Teléfono: 277-3598
Fax: 237-7036



More information about the R-sig-ecology mailing list