title: Reshape Data Long to Wide - understanding reshape parameters
body: <p>I have a long format dataframe dogs that I'm trying to reformat to wide using the reshape() function. It currently looks like so:</p>
  
  <pre><code>dogid  month  year  trainingtype  home  school  timeincomp
  12345  1      2014  1             1     1       340
  12345  2      2014  1             1     1       360
  31323  12     2015  2             7     3       440
  31323  1      2014  1             7     3       500
  31323  2      2014  1             7     3       520
  </code></pre>
  
  <p>The dogid column is a bunch of ids, one for each dog. The month column varies for 1 to 12 for the 12 months, and year from 2014 to 2015. Trainingtype varies for 1 to 2. Each dog has a timeincomp value for every month-year-trainingtype combination, so 48 entries per dog. Home and school vary from 1-8 and are constant per dog (every entry for the same dog has the same school and home). Time in comp is my response variable.</p>
  
  <p>I would like my table to look like so:</p>
  
  <pre><code>dogid  home  school  month1year2014trainingtype1  month2year2014trainingtype1
  12345  1     1       340                          360
  31323  7     3       500                          520
  </code></pre>
  
  <p>etc. (with columns for each month-year-trainingtype combination)</p>
  
  <p>What parameters should I use in reshape to achieve this?</p>