title: Reshaping an data frame in R
body: <p>I have this data frame in long format in R which looks something like this..</p>
  
  <pre><code>Branch.Name Customer.ID Loan.Type Date      Stage       Time
             A    C001    Home      20/11/05  Processing  10
             A    C001    Home      20/11/05  Approval    30
             A    C001    Home      20/11/05  Finalize    5
             A    C002    Business  23/11/05  Processing  30
  </code></pre>
  
  <p>and I want to convert this into the wide format..</p>
  
  <pre><code>Branch.Name Customer.ID Loan.Type   Date     Processing Approval    Finalize
  A           C001        Home        20/11/05    10        30        5
  B           C002        Business    20/11/05    30        10        0
  B           C003        Business    20/11/05    12        15        0
  </code></pre>
  
  <p>I looked at reshape and melt, but I got messed up answers... </p>
  
  <p>Thanks in advance</p>
  
  <p>P.S: Not all rows have "Processing", "Approval" and "Finalize" as stage, some may have extra stages</p>