[R] Boxplot graphic

S Ellison S.Ellison at LGCGroup.com
Wed Jul 25 15:10:12 CEST 2012

Probably the simplest answer is to google 'label boxplot outliers in R'. I found half a dozen solutions, (one of them my own, but that doesn't quite answer your question).

Adding names to a series of data can be as simple as saying
names(x) <- paste("x", 1:length(x))

After that, the solutions google finds answer the question.

One tip: If you want to _replace_ points with names, plot the boxplot with pch=NA (eg
bx <- boxplot(x~g, pch=NA)
to get the boxplot without outliers but with space for them, and then use text(bx$group, bx$out, ...) or similar to put the names in. If you want boxplot to return names, though, you will need to use a modified boxplot function. The first answer Google returns is one such.

S Ellison

> -----Original Message-----
> From: r-help-bounces at r-project.org 
> [mailto:r-help-bounces at r-project.org] On Behalf Of phillen
> Sent: 25 July 2012 12:27
> To: r-help at r-project.org
> Subject: [R] Boxplot graphic
> Dear R-users!
> I boxplotted some data. the class of the data is numeric. 
> There are some outliers and I would like to see their names 
> in the graphic. So, instead that the data points of the 
> outliers are plotted as points, I would like to have their 
> names plotted.
> First of, how can I give my data series (class numeric) 
> names? Second, how could I adjust the boxplot to see the 
> names of the outliers in the graphic instead of the points?
> cheers
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/Boxplot-graphic-tp4637761.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.

This email and any attachments are confidential. Any use...{{dropped:8}}

More information about the R-help mailing list