Hi All- I have 24 boxplots on one graph. I do not have the whiskers extending to the outliers, but I would like to label the maximum value of each outlier above the whiskers. I have the stats but am having trouble figuring out how to label the whiskers. Any suggestions would be great! sherri
Are you trying to find the values of the outliers? Or just how to add the text to the plot in the appropriate place? Or both? -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org (801) 408-8111> -----Original Message----- > From: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] On Behalf Of Sherri Heck > Sent: Tuesday, September 02, 2008 3:38 PM > To: r-help at r-project.org > Subject: [R] boxplot - label outliers > > Hi All- > > I have 24 boxplots on one graph. I do not have the whiskers > extending to the outliers, but I would like to label the > maximum value of each outlier above the whiskers. I have the > stats but am having trouble figuring out how to label the whiskers. > > Any suggestions would be great! > > sherri > > ______________________________________________ > 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. >
Hi Greg, I have the values of the outliers from the boxplot stats. I am just having a difficult time adding the values to the plot in the appropriate places. Hope this is clearer. Thanks! sherri Greg Snow wrote:> Are you trying to find the values of the outliers? Or just how to add the text to the plot in the appropriate place? Or both? > > -- > Gregory (Greg) L. Snow Ph.D. > Statistical Data Center > Intermountain Healthcare > greg.snow at imail.org > (801) 408-8111 > > > > >> -----Original Message----- >> From: r-help-bounces at r-project.org >> [mailto:r-help-bounces at r-project.org] On Behalf Of Sherri Heck >> Sent: Tuesday, September 02, 2008 3:38 PM >> To: r-help at r-project.org >> Subject: [R] boxplot - label outliers >> >> Hi All- >> >> I have 24 boxplots on one graph. I do not have the whiskers >> extending to the outliers, but I would like to label the >> maximum value of each outlier above the whiskers. I have the >> stats but am having trouble figuring out how to label the whiskers. >> >> Any suggestions would be great! >> >> sherri >> >> ______________________________________________ >> 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. >> >> > >
Sherri; The boxplot stats include outlier values in $out and their group number in $group. Let me assume that you want to put the boxes at integer positions on the x-axis (the default is the same). The we have y<-rnorm(60) g<-gl(3,20) labels=paste("Value", 1:length(y)) bx<-boxplot(y~g) bx.at<-1:3 bx<-boxplot(y~g, at=bx.at) for(i in unique(bx$group)) { text(bx.at[i], m<-max(bx$out[bx$group==i]), labels[which(y==m)], pos=4) } #We could possibly use tapply to label the outliers by group, but this for loop labels the maximum outlier. #This toy version will do that if the outliers are below the box too, which is silly, #so you'll need to finagle it a bit to get the 'outermost' outlier labelled.>>> Sherri Heck <sheck at ucar.edu> 02/09/2008 22:37 >>>Hi All- I have 24 boxplots on one graph. I do not have the whiskers extending to the outliers, but I would like to label the maximum value of each outlier above the whiskers. I have the stats but am having trouble figuring out how to label the whiskers. Any suggestions would be great! sherri ______________________________________________ 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. ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}