3-dimensional table
Jeffrey Stratford wrote:
Hi, Last week my class conducted an experiment by putting out clay caterpillars to look at the effects of urbanization, color, and location on caterpillar predation. There were two sites (urban, rural), three colors (green, yellow, red) and two locations at each site (edge, interior). The entire data set is below. I've checked out the MASS book, Dalgaard's book, and the R-help archives and I haven't found anything that suggests how to set up a spreadsheet for the xtab function (say, xtab(predation ~ location + site + color, data=class). It would not be a problem to input the data by hand but I wouldn't know how to set that up either. Any suggestions would be greatly appreciated. The class is mostly college sophmores and juniors and biology and education majors. We are using R 2.2.1 on Windows XP.
Hi Jeff, For some unknown reason, you used the name of a function that I wrote some years ago that may do what you want. Just call it the way you have above and it should work. Jim -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: xtab.R Url: https://stat.ethz.ch/pipermail/r-help/attachments/20060206/08f342cd/xtab.pl -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: xtab.Rd Url: https://stat.ethz.ch/pipermail/r-help/attachments/20060206/08f342cd/xtab-0001.pl