title: How to generate an uneven sequence of numbers in R
body: <p>Here's an example data frame:</p>
  
  <pre><code>df &lt;- data.frame(x=c(1,1,2,2,2,3,3,4,5,6,6,6,9,9),y=c(1,2,3,4,6,3,7,8,6,4,3,7,3,2))
  </code></pre>
  
  <p>I want to generate a sequence of numbers according to the number of observations of <code>y</code> per <code>x</code> group (e.g. there are 2 observations of <code>y</code> for <code>x=1</code>). I want the sequence to be continuously increasing and jumps by 2 after each <code>x</code> group. </p>
  
  <p>The desired output for this example would be:</p>
  
  <pre><code>1,2,5,6,7,10,11,14,17,20,21,22,25,26
  </code></pre>
  
  <p>How can I do this simply in R?</p>