title: Dataframe reshape/transpose using dplyr
body: <p>I have a data frame in the below format 
  <a href="https://i.stack.imgur.com/eSUFV.png" rel="nofollow noreferrer">Original format</a></p>
  
  <p>For a given ID; the age ,sex and status remain the same.</p>
  
  <p>I want to do a couple of transformations </p>
  
  <ol>
  <li>Have a single row for each "Id" and "Type". </li>
  <li>Find unique values in "Tablet" column and do a transpose .</li>
  <li>Transpose "Level" column and have the values corresponding to each tablet under newly transposed tablet column.Empty cells have to be filled with "NA".</li>
  </ol>
  
  <p>The desired output format is attached below for reference.<a href="https://i.stack.imgur.com/WT1Mi.png" rel="nofollow noreferrer">desired format</a></p>
  
  <p>I have tried using dcast and reshape; tidyr with dplyr using gather and spread,however am not able to acheive the 3rd transformation</p>
  
  <p>Any help would be great! Thanks</p>