title: Boxplot outlier labeling in R
body: <p>I want to draw boxplots in R and add names to outliers. So far I found <a href="http://www.r-statistics.com/2011/01/how-to-label-all-the-outliers-in-a-boxplot/" rel="noreferrer">this solution</a>.</p>
  
  <p>The function there provides all the functionality I need, but it scrambles incorrectly the labels. In the following example, it marks the outlier as "u" instead of "o":</p>
  
  <pre><code>library(plyr)
  library(TeachingDemos)
  source("http://www.r-statistics.com/wp-content/uploads/2011/01/boxplot-with-outlier-label-r.txt") # Load the function
  set.seed(1500)
  y &lt;- rnorm(20)
  x1 &lt;- sample(letters[1:2], 20,T)
  lab_y &lt;- sample(letters, 20)
  # plot a boxplot with interactions:
  boxplot.with.outlier.label(y~x1, lab_y)
  </code></pre>
  
  <p>Do you know of any solution? The ggplot2 library is super nice, but provides no such functionality (as far as I know). My alternative is to use the text() function and extract the outlier information from the boxplot object. However, like this the labels may overlap.</p>
  
  <p>Thanks a lot :-)</p>