I have a large data frame that looks similar to this:
df <- data.frame(dive = factor(sample(c("dive1","dive2"), 10, replace=TRUE)),
2015 update with dplyr:
df %>% group_by(dive) %>% summarise(percentage = mean(speed)) Source: local data frame [2 x 2] dive percentage 1 dive1 0.4777462 2 dive2 0.6726483