I have a data.frame with two columns: year and score. The years go from 2000-2012 and each year can be listed multiple times. In the s
data.frame
year
score
If you know sql this is easier to understand
library(sqldf) sqldf('select year, max(score) from mydata group by year')
Update (2016-01): Now you can also use dplyr
library(dplyr) mydata %>% group_by(year) %>% summarise(max = max(score))