title: Group a vector in a rolling fashion
body: <p>I have some years with length N. For e.g.  </p>
  
  <pre><code>yearVec &lt;- 1980:2019
  </code></pre>
  
  <p>I want to group years such that each group has 4 years which are rolling    </p>
  
  <pre><code>group1 1980:1983
  group2 1981:1984
  group3 1982:1985
  .
  .
  .
  groupN 2016:2019
  </code></pre>
  
  <p>Preferably in a list like below </p>
  
  <pre><code>[[1]]
  [1] 1980, 1981, 1982, 1983
  
  [[2]]
  [1] 1981, 1982, 1983, 1984
  
  [[3]]
  [1] 1982, 1983, 1984, 1985
  
  [[4]]
  [1] 1983, 1984, 1985, 1986
  
  [[5]]
  [1] 1984, 1985, 1986, 1987
  </code></pre>