title: dcast in R - creating pivot table
body: <p>Here is my example</p>
  
  <pre><code>Student &lt;- c('A',  'B', 'B')
  Assessor &lt;- c('C',  'D', 'D')
  Score &lt;- c(1, 5, 7)
  df &lt;- data.frame(Student, Assessor, Score)
  df &lt;- dcast(df, Student ~ Assessor,fun.aggregate=(function (x) x), value = 'Score')
  print(df)
  </code></pre>
  
  <p>The output: </p>
  
  <pre><code>Using Score as value column: use value.var to override.
  Error in .fun(.value[0], ...) : unused argument (value = "Score")
  </code></pre>
  
  <p>While I want to get something like</p>
  
  <pre><code>    C    D
  A   1    NaN
  B   NaN  5
  B   NaN  7
  </code></pre>
  
  <p>What I am missing?</p>
  
  <p>In addition, if I replace <code>Score</code> with</p>
  
  <pre><code>Score &lt;- c('foo', 'bar','bar')
  </code></pre>
  
  <p>The output will be:</p>
  
  <pre><code>Using Score as value column: use value.var to override.
  Error in .fun(.value[0], ...) : unused argument (value = "Score")
  </code></pre>
  
  <p>Any thoughts?</p>