title: reshape multi id repeated variable readings from long to wide
body: <p>This is what I have:  </p>
  
  <pre><code>id&lt;-c(1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2)
  measure&lt;-c("speed","weight","time","speed","weight","time","speed","weight","time",
             "speed","weight","time","speed","weight","time","speed","weight","time")
  value&lt;-c(1.23,10.3,33,1.44,10.4,31,1.21,10.1,33,4.25,12.5,38,1.74,10.8,31,3.21,10.3,33)
  testdf&lt;-data.frame(id,measure,value) 
  </code></pre>
  
  <p>This is what I want:</p>
  
  <pre><code>id&lt;-c(1,1,1,2,2,2)  
  speed&lt;-c(1.23,1.44,1.21,4.25,1.74,3.21)
  weight&lt;-c(10.3,10.4,10.1,12.5,10.8,10.3)
  time&lt;-c(33,31,33,37,31,33)
  res&lt;-data.frame(id,speed,weight,time) 
  </code></pre>
  
  <p>The issue lies in that my variables speed weight and time are repeated. I can get it done with a for loop with if statements but its a major headache and not very efficient. This is my first post on stackoverflow ... long time user first time question ... thanks yall!</p>