title: Reshape dataframe by ID
body: <p>I have a data set like</p>
  
  <pre><code>id  age edu blood       
  1   30-39   Primary 5.5     
  1   20-29   Secondary   8.7     
  1   30-39   Primary 10      
  2   30-39   Primary 11      
  2   20-29   Secondary   10      
  2   20-29   Secondary   9       
  </code></pre>
  
  <p>I want id wise output like this:                </p>
  
  <pre><code>id  age30_39count   age20_29count   edu_pri_count   edu_sec_count   blood_median
  1   2   1   2   1   8.7
  2   1   2   1   2   10
  </code></pre>
  
  <p>I have tried R code:</p>
  
  <pre><code>library(dplyr)
  library(tidyr)
  
  ddply(dat, "id", spread, age, age, edu, edu, blood, blood_median=median(blood))
  </code></pre>
  
  <p>But it not showing desired result. Could anybody do help?</p>