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))
More Related Contents:
- Finding running maximum by group
- How to find the highest value of a column in a data frame in R?
- How to extract the row with min or max values?
- Is there a vectorized parallel max() and min()?
- Find value corresponding to maximum in other column [duplicate]
- How can I take pairwise parallel maximum or minimum between two vectors?
- min for each row in a data frame
- Finding the maximum value for each row among 3 columns in R
- Pass a data.frame column name to a function
- Gradient of n colors ranging from color 1 and color 2
- Check if the number is integer
- How can I plot data with confidence intervals?
- R list of lists to data.frame
- Is it possible to use spread on multiple columns in tidyr similar to dcast? [duplicate]
- R – image of a pixel matrix?
- Is it possible to stop executing of R code inside shiny (without stopping the shiny process)?
- Returning anonymous functions from lapply – what is going wrong?
- Euclidean distance of two vectors
- Get rid of \addlinespace in kable
- How to merge and sum two data frames
- find neighbouring elements of a matrix in R
- dplyr mutate rowwise max of range of columns
- Splitting a data frame into equal parts
- How to draw a nice arrow in ggplot2
- Deploying R shiny app as a standalone application [closed]
- Getting a function name as a string
- How to convert dd/mm/yy to yyyy-mm-dd in R
- Connect stack bar charts with multiple groups with lines or segments using ggplot 2
- How to display emojis in ggplot2 using emo package in R?
- Split a string column into several dummy variables