[R] Plot using treatment letter as points

Greg Snow Greg.Snow at imail.org
Tue Feb 8 23:39:25 CET 2011


xyplot is a lattice plotting command, text is a base plotting command.  The 2 types don't play well together without extra work.  The base command plot with text is probably the easiest, or you can just use plot and pch:

> with(iris, plot(Sepal.Width, Sepal.Length, pch=c('s','e','i')[Species] ) )



-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Schatzi
> Sent: Tuesday, February 08, 2011 2:01 PM
> To: r-help at r-project.org
> Subject: Re: [R] Plot using treatment letter as points
> 
> 
> Great. Thanks. Here is the new code:
> 
> xyplot(Y~X,groups = TRT,type="n")
> text(x,y,labels=TRT)
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/Plot-using-
> treatment-letter-as-points-tp3276743p3276808.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list