[R] all (y,x) data in one plot

From: Judy Chung <cp3942_at_gmail.com>
Date: Thu 08 Dec 2005 - 20:59:31 EST


Dear R users:

   I want to plot all the Y1 vs. X1 which in list "coffee" together, in the same plot.
> coffee

[[1]]
  Y1 X1

1  0.0 10.006306
2  0.5  9.433443
3  1.0  8.893405
4  2.0  7.904274

[[2]]
  Y1        X1
1  0.0 10.015972
2  0.5  9.460064

3 1.0 8.935039
4 2.0 7.970755

[[3]]
  Y1 X1

1  0.0 9.985741
2  0.5 9.552583
3  1.0 9.138239
4  2.0 8.362664

[[4]]
.......

[[5]]
.......

> x1<-coffee[[1]]$Y1
> y1<-coffee[[1]]$X1
> x2<-coffee[[2]]$Y1
> y2<-coffee[[2]]$X1
> x3<-coffee[[3]]$Y1
> y3<-coffee[[3]]$X1

.....
> plot(y1~x1)
> points(y2~x2)
> points(y3~x3)

.......
Because I am a newbie in R, so I just can use the above method to solve the problem.
If there is a smarter way to this.
Thanks for any help.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Dec 08 21:12:09 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:34 EST