Tracking the rotation sizes of NBA contenders (top 3 in conference in reg. season) as the season progresses.
Teams tend to shrink their rotations as the season progresses but there are teams like the 76ers who counter this trend by playing deeper rotations later in the year.
Teams have a tendency to increase rotation size in the month before the playoffs, most likely to maximize rest.
Nuggets have gradually decreased rotation sizes as the season progresses, with an end of season bump in ’21.
rotation = number of players who play 5 or more minutes.
monthly average = average rotation size for games played within designated month.
All tables are sortable by clicking on header.
library(tidyverse)
library(nbastatR)
library(dplyr)
library(plotly)
library(tidyr)
library(reactable)
library(reactablefmtr)
Sys.setenv("VROOM_CONNECTION_SIZE" = 131072 * 2)
gl <- game_logs(
seasons = 2023,
season_types = "Regular Season",
league = "NBA",
result_types = "player"
)
## Acquiring NBA basic player game logs for the 2022-23 Regular Season
gl %>% filter(nameTeam == "Denver Nuggets") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "lightblue")) %>%
layout( title = "Nuggets 2023 Rotation",
showlegend = FALSE,
plot_bgcolor = "grey")
gl %>% filter(nameTeam == "Denver Nuggets") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())
gl %>% filter(nameTeam == "Memphis Grizzlies") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "gold")) %>%
layout( title = "Grizzlies 2023 Rotation",
showlegend = FALSE,
plot_bgcolor = "lightgrey")
gl %>% filter(nameTeam == "Memphis Grizzlies") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())
gl %>% filter(nameTeam == "Sacramento Kings") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "purple")) %>%
layout( title = "Kings 2023 Rotation",
showlegend = FALSE,
plot_bgcolor = "lightgrey")
gl %>% filter(nameTeam == "Sacramento Kings") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())
gl %>% filter(nameTeam == "Boston Celtics") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "green")) %>%
layout( title = "Celtics 2023 Rotation",
showlegend = FALSE,
plot_bgcolor = "lightgrey")
gl %>% filter(nameTeam == "Boston Celtics") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())
gl %>% filter(nameTeam == "Milwaukee Bucks") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "tan")) %>%
layout( title = "Bucks 2023 Rotation",
showlegend = FALSE,
plot_bgcolor = "lightgrey")
gl %>% filter(nameTeam == "Milwaukee Bucks") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())
gl %>% filter(nameTeam == "Philadelphia 76ers") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "blue")) %>%
layout( title = "76ers 2023 Rotation",
showlegend = FALSE,
plot_bgcolor = "grey")
gl %>% filter(nameTeam == "Philadelphia 76ers") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())
gl_22 <- game_logs(
seasons = 2022,
season_types = "Regular Season",
league = "NBA",
result_types = "player"
)
## Acquiring NBA basic player game logs for the 2021-22 Regular Season
gl_22 %>% filter(nameTeam == "Golden State Warriors") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "blue")) %>%
layout( title = "Warriors 2022 Rotation",
showlegend = FALSE,
plot_bgcolor = "grey")
gl_22 %>% filter(nameTeam == "Golden State Warriors") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())
gl_22 %>% filter(nameTeam == "Phoenix Suns") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "orange")) %>%
layout( title = "Suns 2022 Rotation",
showlegend = FALSE,
plot_bgcolor = "grey")
gl_22 %>% filter(nameTeam == "Phoenix Suns") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())
gl_22 %>% filter(nameTeam == "Memphis Grizzlies") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "gold")) %>%
layout( title = "Grizzlies 2022 Rotation",
showlegend = FALSE,
plot_bgcolor = "grey")
gl_22 %>% filter(nameTeam == "Memphis Grizzlies") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())
gl_22 %>% filter(nameTeam == "Boston Celtics") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "green")) %>%
layout( title = "Celtics 2022 Rotation",
showlegend = FALSE,
plot_bgcolor = "grey")
gl_22 %>% filter(nameTeam == "Boston Celtics") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())
gl_22 %>% filter(nameTeam == "Miami Heat") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "red")) %>%
layout( title = "Heat 2022 Rotation",
showlegend = FALSE,
plot_bgcolor = "grey")
gl_22 %>% filter(nameTeam == "Miami Heat") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())
gl_22 %>% filter(nameTeam == "Milwaukee Bucks") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "tan")) %>%
layout( title = "Bucks 2022 Rotation",
showlegend = FALSE,
plot_bgcolor = "grey")
gl_22 %>% filter(nameTeam == "Milwaukee Bucks") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())
gl_21 <- game_logs(
seasons = 2021,
season_types = "Regular Season",
league = "NBA",
result_types = "player"
)
## Acquiring NBA basic player game logs for the 2020-21 Regular Season
gl_21 %>% filter(nameTeam == "Utah Jazz") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "yellow")) %>%
layout( title = "Jazz 2021 Rotation",
showlegend = FALSE,
plot_bgcolor = "grey")
gl_21 %>% filter(nameTeam == "Utah Jazz") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())
gl_21 %>% filter(nameTeam == "Phoenix Suns") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "orange")) %>%
layout( title = "Suns 2021 Rotation",
showlegend = FALSE,
plot_bgcolor = "grey")
gl_21 %>% filter(nameTeam == "Phoenix Suns") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())
gl_21 %>% filter(nameTeam == "Denver Nuggets") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "lightblue")) %>%
layout( title = "Nuggets 2021 Rotation",
showlegend = FALSE,
plot_bgcolor = "grey")
gl_21 %>% filter(nameTeam == "Denver Nuggets") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())
gl_21 %>% filter(nameTeam == "Philadelphia 76ers") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "blue")) %>%
layout( title = "Sixers 2021 Rotation",
showlegend = FALSE,
plot_bgcolor = "grey")
gl_21 %>% filter(nameTeam == "Philadelphia 76ers") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())
gl_21 %>% filter(nameTeam == "Brooklyn Nets") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "black")) %>%
layout( title = "Nets 2021 Rotation",
showlegend = FALSE,
plot_bgcolor = "grey")
gl_21 %>% filter(nameTeam == "Brooklyn Nets") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())
gl_21 %>% filter(nameTeam == "Milwaukee Bucks") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
plot_ly( x = ~dateGame, y = ~rotation,
type = "scatter",
mode = "line") %>%
add_trace( line = list( color = "tan")) %>%
layout( title = "Bucks 2021 Rotation",
showlegend = FALSE,
plot_bgcolor = "grey")
gl_21 %>% filter(nameTeam == "Milwaukee Bucks") %>%
filter( minutes >= 5) %>%
group_by(dateGame) %>%
summarise(rotation = n_distinct(namePlayer)) %>%
separate_wider_delim(dateGame,
"-",
names = c("year","month","day")) %>%
group_by(month) %>%
summarise('monthly average' = mean(rotation)) %>%
mutate_at(vars('monthly average'), funs(round(.,2))) %>%
reactable(theme = espn())