This is a nice demonstration of the formula interface to aggregate. A
less elegant alternative is to pass lists as arguments.
with(dd,
aggregate(Correct,
by = list(Subject = Subject,
Group = Group),
FUN = function(x) sum(x == 'C')))
Hi:
If you have R 2.11.x or later, one can use the formula version of aggregate():
aggregate(Correct ~ Subject + Group, data = ALLDATA, FUN = function(x)
sum(x == 'C'))
A variety of contributed packages (plyr, data.table, doBy, sqldf and
remix, among others) have similar capabilities.
If you wa
On 05/01/2011 05:28 AM, Kevin Burnham wrote:
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.
Since you did provide a description of your data (e.g., at least
'str(ALLDATA)') so that we know its structure, I will take a guess:
tapply(ALLDATA$Correct, list(ALLDATA$Subject, ALLDATA$Time),
function(x)sum(x=="C"))
On Sat, Apr 30, 2011 at 3:28 PM, Kevin Burnham wrote:
> HI All,
>
> I have a l
4 matches
Mail list logo