title: Expanding a matrix to include rows for each element in an interval
body: <p>I have a data frame containing information on incidents for countries around the world. The structure of the data frame is similar to the following example:</p>
  <pre><code>a &lt;- data.frame(country = c(&quot;AAA&quot; , &quot;BBB&quot; , &quot;CCC&quot;) ,
                  incident = rep(&quot;disaster&quot; , times = 3) ,
                  'start year' = c(1990 , 1995 , 2011) ,
                  'end year' = c(1993 , 1995 , 2012))
  </code></pre>
  <p>giving <code>a</code>:</p>
  <pre><code>  country incident start.year end.year
  1     AAA disaster       1990     1993
  2     BBB disaster       1995     1995
  3     CCC disaster       2011     2012
  </code></pre>
  <p>I would like to transform this so that each row contains the incident for each individual year instead of only the interval. Ideally, it would look like something like this:</p>
  <pre><code>  country incident year
  1     AAA disaster 1990
  2     AAA disaster 1991
  3     AAA disaster 1992
  4     AAA disaster 1993
  5     BBB disaster 1995
  6     CCC disaster 2011
  7     CCC disaster 2012
  </code></pre>
  <p>Is there an optimal code that can transform this to include a start and end year?</p>