[R] tabulate: switching columns and rows

From: Ricardo Rodríguez <webmaster_at_xen.net>
Date: Sun 31 Dec 2006 - 18:18:50 GMT


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

______________________________________________
R-help@stat.math.ethz.ch 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.
Received on Mon Jan 01 05:23:02 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 31 Dec 2006 - 19:31:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.