title: R colSums By Group
body: <p>In the following matrix dataset:  </p>
  
  <pre><code>       1  2   3   4   5  
  1950   7 20  21  15  61  
  1951   2 10   6  26  57  
  1952  12 27  43  37  34  
  1953  14 16  40  47  94  
  1954   2 17  62 113 101  
  1955   3  4  43  99 148  
  1956   2 47  31  85  79  
  1957  17  5  38 216 228  
  1958  11 20  15  76  68  
  1959  16 20  43  30 226  
  1960   9 28  28  70 201  
  1961   1 31 124  74 137  
  1962  12 25  37  41 200  
  </code></pre>
  
  <p>I have been trying to calculate colSums by decade i.e., find sum the each column from 1950-1959 and then from 1960-69 and so on.</p>
  
  <p>I tried tapply, ddply, etc but couldn't figure out something that would actually work.</p>