title: grouping data in R and summing by decade
body: <p>I have the following dataset:</p>
  
  <pre><code>ireland england france year
  5         3      2     1920
  4         3      4     1921
  6         2      1     1922
  3         1      5     1930
  2         5      2     1931
  </code></pre>
  
  <p>I need to summarise the data by 1920's and 1930's. So I need total points for ireland, england and france in the 1920-1922 and then another total point for ireland,england and france in 1930,1931. </p>
  
  <p>Any ideas? I have tried but failed.</p>
  
  <h2>Dataset:</h2>
  
  <pre><code>x &lt;- read.table(text = "ireland england france 
  5         3      2     1920
  4         3      4     1921
  6         2      1     1922
  3         1      5     1930
  2         5      2     1931", header = T)
  </code></pre>