[R] summary stats on continuous data

Daniel Malter daniel at umd.edu
Tue Jun 15 21:03:05 CEST 2010


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)

HTH,
Daniel
-- 
View this message in context: http://r.789695.n4.nabble.com/summary-stats-on-continuous-data-tp2255496p2256384.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list