Skip to content
Prev 334767 / 398506 Next

Calculating group means

Hi,
You could either try:
#dat1 ##dataset
aggregate(latency~.,data=dat1,mean)

#or
?library(data.table)
?dt1 <- data.table(dat1,key=c('subject','conditionNo','state'))
?dt1[,mean(latency),by=c('subject','conditionNo','state')]

A.K.
On Monday, December 23, 2013 2:20 PM, Laura Bethan Thomas [lbt1] <lbt1 at aber.ac.uk> wrote:
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.