I have a large data frame that looks similar to this:
df <- data.frame(dive = factor(sample(c("dive1","dive2"), 10, replace=TRUE)),
aggregate(speed~dive,data=df,FUN=mean) dive speed 1 dive1 0.7059729 2 dive2 0.5473777