# NOT RUN {
library(nbastatR)
library(dplyr)
df_rosters <- get_seasons_rosters(2015:2018)
### Mean Age by Season and Team
df_rosters %>%
group_by(slugSeason, slugTeam) %>%
summarise(ageMean = mean(agePlayer)) %>%
arrange(ageMean) %>%
ungroup()
# }
Run the code above in your browser using DataLab