Try this:

xtabs(V4 ~ X + Y, data = m)



On Thu, Oct 30, 2008 at 9:29 AM, Daren Tan <daren76@hotmail.com> wrote:

>
> 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
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

	[[alternative HTML version deleted]]

