[R] tabulate: switching columns and rows

Ricardo Rodríguez webmaster at xen.net
Sun Dec 31 19:18:50 CET 2006


Hi all,

Please, is there any way of controlling factors in row/columns when using ftable/xtabs? As far as I can see, the last cross-clasifing variable in the formula will appear in columns. The previous ones, in rows. For instance, is it possible to make  tension and replicate appear in columns?

ftable(xtabs(breaks ~ wool + tension + replicate, data = warpbreaks))

After some years using SAS proc tabulate I am afraid I don't get the point with R and cross-tabulation :-( 

Thanks you very much and Happy New Year!

Ricardo

---
Ricardo Rodríguez
Your XEN ICT Team



More information about the R-help mailing list