library('cumplyr')
data(rt.data)
results <- cumddply(rt.data,
c('Subject', 'Block'),
c('Trial'),
function (df) {with(df, mean(RT))})
print(results)
Run the code above in your browser using DataLab