[R] how to convert data from long to wide format ?

Daren Tan daren76 at hotmail.com
Thu Oct 30 12:29:56 CET 2008


Given a dataframe m 
> m
   X Y V3 V4
1 1 A 0.5 1.2
2 1 B 0.2 1.4
3 2 A 0.1 0.9  

How do I convert m to this with V4 as the cell values ? 

   A    B
1 1.2 1.4
2 0.9 NA



More information about the R-help mailing list