title: boxplot with mean points: getting the same order for categorical variable
body: <p>I want to show boxplots with <em>mean</em> values in <strong><em>R</em></strong>. My boxplots are representing catalase activity on 6 different sites, which I want to reorder from North to South with an Referent site at the end (N1,N2,M1,M2,S1,S2,R). I can easily reorder boxplots like this:</p>
  
  <pre><code>levels(data$site)
  [1] "S2" "N1" "R" "N2" "S1" "M1" "M2"
  x = factor(data$site,levels(data$site)[c(2,4,6,7,5,1,3)])
  boxplot(catalase~x, data)
  </code></pre>
  
  <p>But <em>mean</em> values doesn't follow the new ordering.
  I'm calling mean values like this:</p>
  
  <pre><code>means&lt;-tapply(data$catalase, data$site, mean)
  points(means, col="red", pch=19)
  </code></pre>
  
  <p>And tried reorder them like this:</p>
  
  <pre><code>reordered_means = factor(means,levels(means)[c(2,4,6,7,5,1,3)])
  </code></pre>
  
  <p>But obviously that doesn't make sence, since it's not working.
  Suggestions, please?</p>