[R] using tapply with multiple variables

Kevin Burnham
Sat, 30 Apr 2011 19:28:53 -0000

HI All,

I have a long data file generated from a minimal pair test that I gave to
learners of Arabic before and after a phonetic training regime.  For each of
thirty some subjects there are 800 rows of data, from each of 400 items at
pre and posttest.  For each item the subject got correct, there is a 'C'
in
the column 'Correct'.  The line:

tapply(ALLDATA$Correct, ALLDATA$Subject, function(x)sum(x=="C"))

gives me the sum of correct answers for each subject.

However, I would like to have that sum separated by Time (pre or post).  Is
there a simple way to do that?


What if I further wish to separate by Group (T or C)?

Thanks,
Kevin

	[[alternative HTML version deleted]]