title: How split column with separated strings on more rows in R
body: <p>I have data set where one column is a string of values separated by a comma. How to split it into several rows. Please, see original and desired data sets.</p>
  <pre><code>library(data.table)
  
  # Original data set
  df &lt;- data.table(
    x = c(1, 2, 3),
    y = c(&quot;a,b&quot;, &quot;c&quot;, &quot;a,d&quot;)
  )
  
  # Desired data set
  data.table(
    x = c(1, 1, 2, 3, 3),
    y = c(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;a&quot;, &quot;d&quot;)
  )
  </code></pre>
  <p>Thanks!</p>