Hi, Can someone of you tell me why these two simple examples works as "expected", plot(c(1,1,2,2)~c(1,2,1,2),col=c(1,2,3,4),pch=c(1,2,3,4)) coplot(c(1,1,2,2)~c(1,2,1,2)|c("A","A","B","B"),col=c(1,2,3,4),pch=c(1,2,3,4 )) but when I try it with xyplot in the lattice package it fails. xyplot(c(1,1,2,2)~c(1,2,1,2)|c("A","A","B","B"),col=c(1,2,3,4),pch=c(1,2,3,4 )) Do I have to specify colors and symbol types differently with lattice functions or is this a bug? Thanks, Hans Gardfjell Ecology and Environmental Science Ume? University, Sweden -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
--- Hans Gardfjell <hans at eg.umu.se> wrote:> Hi, > > Can someone of you tell me why these two simple examples works as > "expected", > > plot(c(1,1,2,2)~c(1,2,1,2),col=c(1,2,3,4),pch=c(1,2,3,4)) > > coplot(c(1,1,2,2)~c(1,2,1,2)|c("A","A","B","B"),col=c(1,2,3,4),pch=c(1,2,3,4 > )) > > but when I try it with xyplot in the lattice package it fails. > > > xyplot(c(1,1,2,2)~c(1,2,1,2)|c("A","A","B","B"),col=c(1,2,3,4),pch=c(1,2,3,4 > )) > > Do I have to specify colors and symbol types differently with lattice > functions or > is this a bug?Depends on which part you think is unexpected. Both panels should use pch 1 and 2 (and not 3 and 4 for the second panel like coplot), which seems reasonable enough; it starts afresh for each panel. The col isn't vectorized because grid doesn't support vectorized graphical parameters yet (but will do so from the next version). That said, from a design perspective, col and pch should not be vectors at all in your example. S-Plus would actually ignore vectorized col/pch etc (with a warning) and use only the first values. Multiple graphical symbols are supposed to be achieved via the groups argument and panel.superpose. Deepayan __________________________________________________ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Your xyplot(...) command works fine for me. Are you sure the lattice library is correctly loaded, using: library(lattice) Also, what is your plateform and your R /lattice / grid versions? Mine are: _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 1 minor 5.1 year 2002 month 06 day 17 language R under Windows 2000 pro, and: Package: lattice Version: 0.5-3 Date: 2002/05/30 Package: grid Version: 0.6 Date: 2002/04/03 Best, Philippe Grosjean -----Message d'origine----- De : owner-r-help at stat.math.ethz.ch [mailto:owner-r-help at stat.math.ethz.ch]De la part de Hans Gardfjell Envoy? : lundi 29 juillet 2002 04:13 ? : r-help at stat.math.ethz.ch Objet : [R] Bug or feature in xyplot? Hi, Can someone of you tell me why these two simple examples works as "expected", plot(c(1,1,2,2)~c(1,2,1,2),col=c(1,2,3,4),pch=c(1,2,3,4)) coplot(c(1,1,2,2)~c(1,2,1,2)|c("A","A","B","B"),col=c(1,2,3,4),pch=c(1,2,3,4 )) but when I try it with xyplot in the lattice package it fails. xyplot(c(1,1,2,2)~c(1,2,1,2)|c("A","A","B","B"),col=c(1,2,3,4),pch=c(1,2,3,4 )) Do I have to specify colors and symbol types differently with lattice functions or is this a bug? Thanks, Hans Gardfjell Ecology and Environmental Science Ume? University, Sweden -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. -.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._