I just started using R last week. I have a dataset with 3 columns - Plate, Well and Raw I need to make a simple plot(Well~Raw) but only when Plate = 101 Thanks for your help. -- View this message in context: http://r.789695.n4.nabble.com/Simple-conditional-plot-tp3654300p3654300.html Sent from the R help mailing list archive at Nabble.com.
Try plot(Well~Raw, subset= Plate==101) -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of rstudent Sent: Friday, July 08, 2011 8:56 AM To: r-help at r-project.org Subject: [R] Simple conditional plot I just started using R last week. I have a dataset with 3 columns - Plate, Well and Raw I need to make a simple plot(Well~Raw) but only when Plate = 101 Thanks for your help. -- View this message in context: http://r.789695.n4.nabble.com/Simple-conditional-plot-tp3654300p3654300.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.
On Jul 8, 2011, at 10:55 AM, rstudent wrote:> I just started using R last week. > > I have a dataset with 3 columns - Plate, Well and Raw > > I need to make a simple plot(Well~Raw) but only when Plate = 101?subset # Some plotting paradigms allow you to use a subset = <argument> but any program that had a data= option would allow data=subset(dfrm, Plate==101) newseRs: Remember to use double "=="'s> > Thanks for your help. > > -- > View this message in context: http://r.789695.n4.nabble.com/Simple-conditional-plot-tp3654300p3654300.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.David Winsemius, MD West Hartford, CT
Another possibility without using subset(): plot(Well[][Plate==101]~Raw[][Plate==101]) This also works to '>=' '<=' and other conditions. -- View this message in context: http://r.789695.n4.nabble.com/Simple-conditional-plot-tp3654300p3654666.html Sent from the R help mailing list archive at Nabble.com.