[R] Scatterplot question
Andy Bunn
abunn at whrc.org
Thu Dec 9 18:07:32 CET 2004
Something like this will work:
foo.df <- data.frame(x = 1:8, y1 = c(1,3,5, NA, NA, NA, NA, NA),
y2 = c(NA, NA, NA, 7, 9, 11, NA, NA),
y3 = c(NA, NA, NA, NA, NA, NA, 13, 15))
plot(foo.df$x, foo.df$y1, ylim = c(0,20), type = "n")
points(foo.df$x, foo.df$y1, pch = 1)
points(foo.df$x, foo.df$y2, pch = 2)
points(foo.df$x, foo.df$y3, pch = 3)
HTH, Andy
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of
> judith.baltsar at gmx.de
> Sent: Thursday, December 09, 2004 11:41 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Scatterplot question
>
>
> Dear list members,
> I have a probably simple question concerning scatterplots: I want to
> draw a plot with one X but several Y columns, so that every group
> of samples gets a different symbol. My table looks like this:
>
> X Y1 Y2 Y3
> 1 1
> 2 3
> 3 5
> 4 7
> 5 9
> 6 11
> 7 13
> 8 15
>
> Simple in Excel or StarOffice, but how do I do it in R?
>
> Thanks a lot
>
> Judith
>
> ______________________________________________
> R-help at 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
More information about the R-help
mailing list