title: Rounding output from by function in R
body: <p>I'm trying to round an output from a simple <code>by()</code> function in <code>R</code>. This is what I have:</p>
  
  <pre><code>&gt; by(glaciers[,1:3],glaciers$activity.level,mean)
  
  glaciers$activity.level: Active
         aspect  sun.duration      latitude 
  -9.444444e+00  1.771778e+03  3.247643e+09 
  -------------------------------------------
  glaciers$activity.level: Inactive
        aspect sun.duration     latitude 
  1.041667e+01 2.067583e+03 4.048301e+09 
  -------------------------------------------
  glaciers$activity.level: Relict
        aspect sun.duration     latitude 
  1.766667e+01 2.168000e+03 2.759283e+09 
  </code></pre>
  
  <p>How can I get my output to round to say 5 decimal places, and still keep the factors?</p>
  
  <p>I've tried: <code>round(by(glaciers[,1:3],glaciers$activity.level,mean),5)</code> but get an error: <code>Non-numeric argument to mathematical function</code>.</p>