On Feb 8, 2011, at 3:42 PM, Schatzi wrote:

>

> I would like to create a plot of y vs x with different treatments

> where the

> points are actually the letter of the treatment. Here is the code:

>

> A<-as.matrix(rnorm(10,10))

> B<-as.matrix(rnorm(10,9.5))

> C<-as.matrix(rnorm(10,10.5))

> Y<-as.matrix(rnorm(30,13))

> X<-rbind(A,B,C)

> nA<-matrix("A",10,1)

> nB<-matrix("B",10,1)

> nC<-matrix("C",10,1)

> TRT<-rbind(nA,nB,nC)

>

> plot(X,Y)

> xyplot(Y~X,groups = TRT)

?plot

?xyplot

> plot(X,Y, pch=LETTERS[1:3], col=1:3)

> xyplot(Y~X,groups = TRT, pch=LETTERS[1:3], col=1:3)

David Winsemius, MD

West Hartford, CT

______________________________________________

[hidden email] mailing list

https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide

http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.