[R] 3-dimensional table

Jeffrey Stratford stratja at auburn.edu
Sun Feb 5 13:36:08 CET 2006


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.   

Again, many thanks,

Jeff

site	location	color	predated
Urban	Edge	Green	5
Urban	Edge	Red	30
Urban	Edge	Yellow	11
Urban	Interior	Green	11
Urban	Interior	Red	22
Urban	Interior	Yellow	22
Rural	Edge	Green	94
Rural	Edge	Red	40
Rural	Edge	Yellow	67
Rural	Interior	Green	40
Rural	Interior	Red	70
Rural	Interior	Yellow	33


****************************************
Jeffrey A. Stratford, Ph.D.
Postdoctoral Associate
331 Funchess Hall
Department of Biological Sciences
Auburn University
Auburn, AL 36849
334-329-9198
FAX 334-844-9234
http://www.auburn.edu/~stratja




More information about the R-help mailing list