title: Mean of triplicate
body: <p>I've just cleaned up a data frame that I scraped from an excel spreadsheet by amongst other things, removing percentage signs from some of the numbers see, <a href="https://stackoverflow.com/questions/14385060/removing-percentages-from-a-data-frame">Removing Percentages from a Data Frame</a>.</p>
  
  <p>The data has twenty four rows representing the parameters and results from eight experiments done in triplicate.  Eg, what one would get from,</p>
  
  <pre><code>DF1 &lt;- data.frame(X = 1:24, Y = 2 * (1:24), Z = 3 * (1:24))
  </code></pre>
  
  <p>I want to find the mean of each of the triplicates (which, fortunately are in sequential order) and create a new data frame with eight rows and the same amount of columns.</p>
  
  <p>I tried to do this using,</p>
  
  <pre><code>DF2 &lt;- data.frame(replicate(3,sapply(DF1, mean)))
  </code></pre>
  
  <p>which gave me the mean of each column as rows three times.  I wanted to get a dataframe that would give me,</p>
  
  <pre><code>data.frame(X = c(2,5,8,11,14,17,20,23), Y = c(4,10,16,22,28,34,40,23), Z = c(6,15,24,33,42,51,60,69))
  </code></pre>
  
  <p>which I worked out by hand; it's supposed to be the reduced result.</p>
  
  <p>Thanks, ...</p>
  
  <p>Any help would be gratefully recieved. </p>