Or using the original data and the subset argument of boxplot: boxplot(Barium~Well.ID,data=mydata, main="Barium", ylab="mg/L", subset = Well.ID %in% c("MW-1", "MW-2"))
Yours sincerely / Med venlig hilsen Frede Aakmann Tøgersen Specialist, M.Sc., Ph.D. Plant Performance & Modeling Technology & Service Solutions T +45 9730 5135 M +45 2547 6050 fr...@vestas.com http://www.vestas.com Company reg. name: Vestas Wind Systems A/S This e-mail is subject to our e-mail disclaimer statement. Please refer to www.vestas.com/legal/notice If you have received this e-mail in error please contact the sender. > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Jim Lemon > Sent: 4. april 2014 05:55 > To: David Doyle > Cc: r-help@r-project.org > Subject: Re: [R] Doing box plots for part of the data?? > > On 04/04/2014 02:20 PM, David Doyle wrote: > > HI folks > > > > I'm wanting to do box plots of just 2 of my wells. > > > > I can do it for all of them by using > > > > boxplot(Barium~Well.ID,data=mydata, main="Barium", ylab="mg/L") > > > > to do for all 4 wells > > Anyone have a sugestion on how to do it for only 2 wells like MW-1 and > MW-2? > > > > The data can be found? > > http://www.doylesdartden.com/TEMP/mydata.csv > > > > Hi David, > Try this: > > dddf<-read.csv("mydata.csv") > dddf12<-dddf[dddf$Well.ID=="MW-1" | dddf$Well.ID=="MW-2",] > dddf12$Well.ID<-factor(dddf12$Well.ID,levels=c("MW-1","MW-2")) > boxplot(Barium~Well.ID,dddf12) > > Jim > > ______________________________________________ > R-help@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. ______________________________________________ R-help@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.