title: Merge with repeated row.names in R
body: <p>I am trying to merge two data frames with repeated row.names and it gives me the error : 'by' must specify a uniquely valid column.</p>
  
  <p>Given the code below, I want my newly merged data frame to have two rows with "a" "100" "chicken and "a" "100" "beef". Do anyone know whats the easiest way to do it if I have multiple repetitions?</p>
  
  <pre><code>name   &lt;- c("a", "b", "c")
  height &lt;- c(100, 150, 160)
  x      &lt;- data.frame(name, height)
  
  name   &lt;- c("a", "a", "b")
  food   &lt;- c("chicken", "beef", "salad")
  y      &lt;- data.frame(name, food)
  
  merge(x,y,by = "name")
  </code></pre>
  
  <p>My desired result:</p>
  
  <pre><code>name  &lt;- c("a", "a", "b", "c")
  height &lt;- c(100, 100, 150, 160)
  food   &lt;- c("chicken", "beef", "salad", "NA")
  data.frame(name, height, food)
  </code></pre>
  
  <p>Thanks</p>