> Thanks, Hadley,
>
> My fault: I've not provided the line concerning replicate variable. It is 
> included in ?xtabs:
>
> warpbreaks$replicate <- rep(1:9, len = 54)
>
> It will be great to have an example with these given data. Anyway, I will 
> have a look to reshape at the given site. Thanks a lot!


install.packages("reshape")
library(reshape)

wm <- melt(warpbreaks, m="breaks")
cast(wm, wool ~ tension + replicate)

# Or as a 3d array
cast(wm, wool ~ tension ~ replicate)

# Or aggregate over replicates:
cast(wm, wool ~ tension, mean)
cast(wm, wool ~ tension, length)

Regards,

Hadley

______________________________________________
[email protected] 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.

Reply via email to