title: Using the reshape function in R with multiple matching rows
body: <p>So I have the following data frame <code>df</code>:</p>
  
  <pre><code>       X     Y     Z     ID     value
  1      0    20    135    a       20
  2      0    20    135    a       30
  3      0    20    135    b       40
  4      20   104    20    c       10
  5      20   104    20    b       15
  ...
  </code></pre>
  
  <p>I want a final output of</p>
  
  <pre><code>       X     Y     Z     a     b     c     
  1      0    20    135    20    40    null
  2      0    20    135    30    null  null
  3      20   104    20    null  15    10
  ...
  </code></pre>
  
  <p>I'd like to turn all the different IDs to individual columns holding the values from the original data frame. What I'm currently doing is 
  <code>reshape(df, idvar=c("X", "Y", "Z"), timevar="ID", direction="wide")</code>. However, this results in warnings of having multiple rows match for each of <code>a</code> <code>b</code> and <code>c</code>, and thus only the first are taken. I want a row for each unique <code>X</code>, <code>Y</code>, <code>Z</code> combination but since there are many repeated measurements I want multiple rows for each combination as well, but the number of repeated measurements differs for each <code>a</code>, <code>b</code>, and <code>c</code>. Is there any way of doing this effectively? </p>