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
one liner,
df_2<-data.frame(year=sort(unique(df$year)),score = tapply(df$score,df$year,max));