title: R spreading multiple columns with tidyr
body: <p>Take this sample variable</p>
  
  <pre><code>df &lt;- data.frame(month=rep(1:3,2),
                   student=rep(c("Amy", "Bob"), each=3),
                   A=c(9, 7, 6, 8, 6, 9),
                   B=c(6, 7, 8, 5, 6, 7))
  </code></pre>
  
  <p>I can use <code>spread</code> from <code>tidyr</code> to change this to wide format.</p>
  
  <pre><code>&gt; df[, -4] %&gt;% spread(student, A)
    month Amy Bob
  1     1   9   8
  2     2   7   6
  3     3   6   9
  </code></pre>
  
  <p>But how can I spread two values e.g. both <code>A</code> and <code>B</code>, such that the output is something like</p>
  
  <pre><code>  month Amy.A Bob.A Amy.B Bob.B
  1     1     9     8     6     5
  2     2     7     6     7     6
  3     3     6     9     8     7
  </code></pre>