Re: [R] summary stats on continuous data

From: Daniel Malter <>
Date: Tue, 15 Jun 2010 12:03:05 -0700 (PDT)

You can define a function that does just that: sum the 1s in Acc and divide by the length of Acc. Then use tapply to apply the function for each subject.

f=function(x){sum(as.numeric(as.character(x)))/length(x)} tapply(d$Acc,list(d$S),f)


View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 15 Jun 2010 - 19:06:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 15 Jun 2010 - 19:10:31 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive