How can I get the outlier in this boxplot of "Score" to be represented by the corresponding value in "SubNo"? score=c(6,6,7,14,5,7,6,8) SubNo=1:8 mydata=data.frame(SubNo, score) boxplot(mydata$score) Thanks! Kevin [[alternative HTML version deleted]]
SubNo[identify(rep(1,8),mydata$score)] -- Clint Bowman INTERNET: clint at ecy.wa.gov Air Quality Modeler INTERNET: clint at math.utah.edu Department of Ecology VOICE: (360) 407-6815 PO Box 47600 FAX: (360) 407-7534 Olympia, WA 98504-7600 On Wed, 15 Sep 2010, Kevin Burnham wrote:> How can I get the outlier in this boxplot of "Score" to be represented by > the corresponding value in "SubNo"? > > score=c(6,6,7,14,5,7,6,8) > SubNo=1:8 > mydata=data.frame(SubNo, score) > boxplot(mydata$score) > > > Thanks! > Kevin > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. >
Kevin -
Here's one way:
> z = boxplot(mydata$score,outline=FALSE,ylim=range(mydata$score))
> text(1,z$out,SubNo[which(score == z$out)])
- Phil Spector
Statistical Computing Facility
Department of Statistics
UC Berkeley
spector at stat.berkeley.edu
On Wed, 15 Sep 2010, Kevin Burnham wrote:
> How can I get the outlier in this boxplot of "Score" to be
represented by
> the corresponding value in "SubNo"?
>
> score=c(6,6,7,14,5,7,6,8)
> SubNo=1:8
> mydata=data.frame(SubNo, score)
> boxplot(mydata$score)
>
>
> Thanks!
> Kevin
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>