title: dcast issue on dataframe consisting two columns
body: <p>I have a dataframe with two columns and trying to convert it two wide format as shown below. However, I am not able to figure out for a data frame consisting only a numeric and a non numeric column.</p>
  
  <pre><code>library(tidyverse)
  library(reshape2)
  
  sample_frame&lt;-data.frame(id=c("x","x","y","y","z","z"),value=c(1,2,3,4,5,6))
  
  desired_output&lt;-cbind(x=filter(sample_frame,id=="x")$value,
                         y=filter(sample_frame,id=="y")$value,
                        z=filter(sample_frame,id=="z")$value)
  sample_frame
  desired_output
  
  desired_output&lt;-dcast(sample_frame,id~.,value.var="value")
  desired_output
  
  &gt; sample_frame
    id value
  1  x     1
  2  x     2
  3  y     3
  4  y     4
  5  z     5
  6  z     6
  &gt; desired_output
       x y z
  [1,] 1 3 5
  [2,] 2 4 6
  &gt; 
  &gt; desired_output&lt;-dcast(sample_frame,id~.,value.var="value")
  Aggregation function missing: defaulting to length
  &gt; desired_output
    id .
  1  x 2
  2  y 2
  3  z 2
  </code></pre>
  
  <p>As shown above using dcast is giving me aggregation.</p>