title: Transform a string in a data frame to a vector and unnest the data frame
body: <p>Given a data frame where each observation in a column is a string of the form "x~y" where x and y are integers.</p>
  
  <p>The goal is to transform the "x~y" string into a vector, c(x..y) which is a sequence of numbers that start with integer x and end with integer y. </p>
  
  <p>Finally, the data frame needs to be unnested so that each element of the vector gets its own row and the other columns are properly repeated.</p>
  
  <p>For example, here's a data frame:</p>
  
  <pre><code>A     B
  A1  -1~1
  A2   1~3
  A3   2~4
  </code></pre>
  
  <p>The above data frame should be changed to the following:</p>
  
  <pre><code>  A     B
      A1   -1
      A1    0
      A1    1
      A2    1
      A2    2
      A2    3
      A3    2
      A3    3
      A3    4
  </code></pre>
  
  <p>It is impossible to set the str_replace examples as there are lots of cases..
  How do I make this code??</p>