title: for the length of each row in column Y duplicate row in column X
body: <p>(Please feel free to adjust title to something more fitting)</p>
  
  <p>I have a <code>data.frame</code> with two columns, <code>X</code> and <code>Y</code> of class <code>list</code> as below</p>
  
  <pre><code>X &lt;- list("A","B","C","D")
  Y &lt;- list("a",c("a", "b"),"c",c("a", "c", "d"))
  
  df &lt;- as.data.frame(cbind(X,Y))
  </code></pre>
  
  <p>When column <code>Y</code> has two or more entries or as here characters, I would like for the length of each row in <code>Y</code> (number of characters) to correspond to the number of identical rows in column <code>X</code>. Easier put, for each character in <code>Y</code> their must be an individual row in <code>X</code>.</p>
  
  <pre><code># desired output
  
  X Y
  A a
  B a
  B b
  C c
  D a
  D c
  D d
  </code></pre>
  
  <p>Im not sure how to go about this, so any pointers would be appreciated, thanks!</p>