title: Boxplots ranked by mean value
body: <p>I would like to show boxplots for multiple variables, and rank them by column means in descending order, just like in the <em>Performance Analytics</em> package. I use the following code to generate the boxplots:</p>
  
  <pre><code>zx &lt;- replicate (5, rnorm(50))
  zx_means &lt;- (colMeans(zx, na.rm = TRUE))
  boxplot(zx, horizontal = FALSE, outline = FALSE)
  points(zx_means, pch = 22, col = "darkgrey", lwd = 7)
  </code></pre>
  
  <p>So far I have not been able to come up with a way to rank them as described above. I have tried using both <em>sort</em> and <em>order</em>, but without any satisfying results so far. </p>
  
  <p>Any help would be much appreciated.</p>