[R] all (y,x) data in one plot
Judy Chung
cp3942 at gmail.com
Thu Dec 8 10:59:31 CET 2005
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.
More information about the R-help
mailing list