gtlibrary(tidyverse)
library(lubridate, warn.conflicts = FALSE)
library(gt)
First lets take a look at our starters:
asg_starters %>%
select(player, team_slug) %>%
gt() %>%
tab_header(
title = md("**NBA All-Star Game Starters**"),
) %>%
cols_label(player = md("**Player Name**"),
team_slug = md("**Team**")) %>%
tab_footnote(
footnote = "Team captain",
locations = cells_data(
columns = vars(player),
rows = c(1, 8))
) %>%
tab_options(footnote.glyph = c("*, †, ‡"))
| NBA All-Star Game Starters | |
|---|---|
| Player Name | Team |
| Giannis Antetokounmpo* | MIL |
| Stephen Curry | GSW |
| Kevin Durant | GSW |
| Joel Embiid | PHI |
| Paul George | OKC |
| James Harden | HOU |
| Kyrie Irving | BOS |
| LeBron James* | LAL |
| Kawhi Leonard | TOR |
| Kemba Walker | CHA |
| * Team captain | |
Now the All-Star reserves:
asg_reserves %>%
select(player, team_slug) %>%
gt() %>%
tab_header(
title = md("**NBA All-Star Game Reserves**"),
) %>%
cols_label(player = md("**Player Name**"),
team_slug = md("**Team**"))
| NBA All-Star Game Reserves | |
|---|---|
| Player Name | Team |
| LaMarcus Aldridge | SAS |
| Bradley Beal | WAS |
| Anthony Davis | NOP |
| Blake Griffin | DET |
| Nikola Jokic | DEN |
| Damian Lillard | POR |
| Kyle Lowry | TOR |
| Khris Middleton | MIL |
| Victor Oladipo | IND |
| Ben Simmons | PHI |
| Klay Thompson | GSW |
| Karl-Anthony Towns | MIN |
| Nikola Vucevic | ORL |
| Russell Westbrook | OKC |
We’ve also got a category I’m calling “specials.” Brooklyn Nets guard D’Angelo Russell was named by NBA Commissioner Adam Silver as the replacement for Victor Oladipo, who ruptured a quad tendon in a game against the Raptors on January 23.1
Silver also added Dirk Nowitzki and Dwyane Wade as “special team roster additions” because, well, they’re Dirk Nowitzki and D. Wade.2
asg_special %>%
select(player, team_slug) %>%
gt() %>%
tab_header(
title = md("**NBA All-Star Game Special Selections**"),
) %>%
cols_label(player = md("**Player Name**"),
team_slug = md("**Team**"))
| NBA All-Star Game Special Selections | |
|---|---|
| Player Name | Team |
| D'Angelo Russell | BKN |
| Dirk Nowitzki | DAL |
| Dwyane Wade | MIA |
We’ve got voting data, which I scraped and wrangled in an earlier missive.3
| Western Conference Frontcourt | |||||||
|---|---|---|---|---|---|---|---|
| NBA All-Star Voting 2019 Results | |||||||
| Rank | Player Name | Team | Fan Rank | Player Rank | Media Rank | Weighted Score | |
| 1 | LeBron James*, † | LAL | 1 | 1 | 1 | 1.00 | |
| 2 | Kevin Durant* | GSW | 3 | 2 | 2 | 2.50 | |
| 3 | Paul George* | OKC | 4 | 4 | 4 | 4.00 ‡ | |
| 4 | Anthony Davis | NOP | 5 | 3 | 3 | 4.00 ‡ | |
| 5 | Luka Doncic | DAL | 2 | 8 | 6 | 4.50 | |
| 6 | Nikola Jokic | DEN | 7 | 5 | 5 | 6.00 | |
| 7 | Steven Adams | OKC | 6 | 7 | 8 | 6.75 | |
| 8 | Draymond Green | GSW | 9 | 10 | 8 | 9.00 | |
| 9 | Karl-Anthony Towns | MIN | 11 | 10 | 8 | 10.00 | |
| 10 | LaMarcus Aldridge | SAS | 13 | 6 | 8 | 10.00 | |
| source: nba.com | |||||||
| * Voted to start † Team captain ‡ Tiebreaker for starting spot is fan rank |
|||||||
| Western Conference Backcourt | |||||||
|---|---|---|---|---|---|---|---|
| NBA All-Star Voting 2019 Results | |||||||
| Rank | Player Name | Team | Fan Rank | Player Rank | Media Rank | Weighted Score | |
| 1 | Stephen Curry* | GSW | 1 | 1 | 2 | 1.25 | |
| 2 | James Harden* | HOU | 3 | 2 | 1 | 2.25 | |
| 3 | Derrick Rose | MIN | 2 | 4 | 6 | 3.50 | |
| 4 | Russell Westbrook | OKC | 4 | 3 | 3 | 3.50 | |
| 5 | Damian Lillard | POR | 6 | 5 | 4 | 5.25 | |
| 6 | Klay Thompson | GSW | 5 | 11 | 4 | 6.25 | |
| 7 | DeMar DeRozan | SAS | 7 | 8 | 6 | 7.00 | |
| 8 | Devin Booker | PHX | 10 | 6 | 6 | 8.00 | |
| 9 | Lonzo Ball | LAL | 8 | 14 | 6 | 9.00 | |
| 10 | Chris Paul | HOU | 9 | 14 | 6 | 9.50 | |
| source: nba.com | |||||||
| * Voted to start | |||||||
| Eastern Conference Frontcourt | |||||||
|---|---|---|---|---|---|---|---|
| NBA All-Star Voting 2019 Results | |||||||
| Rank | Player Name | Team | Fan Rank | Player Rank | Media Rank | Weighted Score | |
| 1 | Giannis Antetokounmpo*, † | MIL | 1 | 1 | 1 | 1.00 | |
| 2 | Kawhi Leonard* | TOR | 2 | 2 | 1 | 1.75 | |
| 3 | Joel Embiid* | PHI | 3 | 3 | 1 | 2.50 | |
| 4 | Jayson Tatum | BOS | 4 | 7 | 4 | 4.75 | |
| 5 | Jimmy Butler | PHI | 5 | 4 | 7 | 5.25 | |
| 6 | Blake Griffin | DET | 6 | 5 | 7 | 6.00 | |
| 7 | Pascal Siakam | TOR | 8 | 10 | 4 | 7.50 | |
| 8 | Vince Carter | ATL | 7 | 12 | 7 | 8.25 | |
| 9 | Andre Drummond | DET | 12 | 6 | 7 | 9.25 | |
| 10 | Nikola Vucevic | ORL | 13 | 9 | 4 | 9.75 | |
| source: nba.com | |||||||
| * Voted to start † Team captain |
|||||||
| Eastern Conference Backcourt | |||||||
|---|---|---|---|---|---|---|---|
| NBA All-Star Voting 2019 Results | |||||||
| Rank | Player Name | Team | Fan Rank | Player Rank | Media Rank | Weighted Score | |
| 1 | Kyrie Irving* | BOS | 1 | 1 | 1 | 1.0 | |
| 2 | Kemba Walker* | CHA | 3 | 2 | 2 | 2.5 | |
| 3 | Dwyane Wade | MIA | 2 | 6 | 6 | 4.0 | |
| 4 | Ben Simmons | PHI | 4 | 5 | 3 | 4.0 | |
| 5 | Victor Oladipo | IND | 5 | 4 | 4 | 4.5 | |
| 6 | Kyle Lowry | TOR | 6 | 7 | 7 | 6.5 | |
| 7 | Bradley Beal | WAS | 10 | 3 | 5 | 7.0 | |
| 8 | Zach LaVine | CHI | 7 | 8 | 8 | 7.5 | |
| 9 | D'Angelo Russell | BKN | 11 | 10 | 8 | 10.0 | |
| 10 | Eric Bledsoe | MIL | 16 | 8 | 8 | 12.0 | |
| source: nba.com | |||||||
| * Voted to start. | |||||||
Let’s get some more data on our actual selected All-Star team. First I’ll combine the starters, reserves, and “specials” into a single data frame.
asg_players <- bind_rows(asg_starters, asg_reserves, asg_special)
Next will bring in the All-Star voting data Note that I’m using two columns for the join not because I necessarily need them, but to avoid name repair which (by default) would leave me with two variables, team_slug.x and team_slug.y, in the resulting data frame.
asg_data <- asg_players %>%
left_join(asg_votes, by = c("player", "team_slug"))
I’m also gonna ditch those last four columns, since they were a mess of my own making from the initial data scraping, and I’m pretty sure they have variable names that will bork something up somewhere.
asg_data <- asg_data[,1:13]
Next, let’s take a look at the players who were “least deserving” of their selection according to player, fan, and media rankings. We’ll group by conf_court, since the voting is does that way, and, thus each combination of Eastern/Western conferences and front/back courts has their own ranking.
rank_vars <- c("player", "team_slug", "player_rank", "fan_rank", "media_rank", "weighted_score", "conf_court")
asg_data %>%
group_by(conf_court) %>%
filter(player_rank == max(player_rank)) %>%
select(rank_vars) %>%
gt() %>%
tab_header(
title = md("**Least Deserving: Player Rank**"),
) %>%
cols_label(player = md("**Player Name**"),
team_slug = md("**Team**"),
fan_rank = md("**Fan Rank**"),
player_rank = md("**Player Rank**"),
media_rank = md("**Media Rank**"),
weighted_score = md("**Weighted Score**")) %>%
tab_style(
style = cells_styles(
bkgd_color = "lightpink"),
locations = cells_data(
columns = vars(player_rank)
)
) %>%
tab_source_note(md("source: [nba.com](http://www.nba.com/article/2019/01/24/2019-nba-all-star-starters-revealed-official-release)")) %>%
tab_options(stub_group.font.weight = "600",
sourcenote.padding = px(10))
| Least Deserving: Player Rank | ||||||
|---|---|---|---|---|---|---|
| Player Name | Team | Player Rank | Fan Rank | Media Rank | Weighted Score | |
| western backcourt | ||||||
| Klay Thompson | GSW | 11 | 5 | 4 | 6.25 | |
| eastern frontcourt | ||||||
| Nikola Vucevic | ORL | 9 | 13 | 4 | 9.75 | |
| eastern backcourt | ||||||
| D'Angelo Russell | BKN | 10 | 11 | 8 | 10.00 | |
| western frontcourt | ||||||
| Dirk Nowitzki | DAL | 30 | 15 | 8 | 17.00 | |
| source: nba.com | ||||||
| Least Deserving: Fan Rank | ||||||
|---|---|---|---|---|---|---|
| Player Name | Team | Player Rank | Fan Rank | Media Rank | Weighted Score | |
| western backcourt | ||||||
| Damian Lillard | POR | 5 | 6 | 4 | 5.25 | |
| eastern frontcourt | ||||||
| Khris Middleton | MIL | 8 | 14 | 7 | 10.75 | |
| eastern backcourt | ||||||
| D'Angelo Russell | BKN | 10 | 11 | 8 | 10.00 | |
| western frontcourt | ||||||
| Dirk Nowitzki | DAL | 30 | 15 | 8 | 17.00 | |
| source: nba.com | ||||||
| Least Deserving: Media Rank | ||||||
|---|---|---|---|---|---|---|
| Player Name | Team | Player Rank | Fan Rank | Media Rank | Weighted Score | |
| western frontcourt | ||||||
| LaMarcus Aldridge | SAS | 6 | 13 | 8 | 10.00 | |
| Karl-Anthony Towns | MIN | 10 | 11 | 8 | 10.00 | |
| Dirk Nowitzki | DAL | 30 | 15 | 8 | 17.00 | |
| eastern frontcourt | ||||||
| Blake Griffin | DET | 5 | 6 | 7 | 6.00 | |
| Khris Middleton | MIL | 8 | 14 | 7 | 10.75 | |
| western backcourt | ||||||
| Damian Lillard | POR | 5 | 6 | 4 | 5.25 | |
| Klay Thompson | GSW | 11 | 5 | 4 | 6.25 | |
| eastern backcourt | ||||||
| D'Angelo Russell | BKN | 10 | 11 | 8 | 10.00 | |
| source: nba.com | ||||||
Why so many in this last round? Well, the media happened to have quite a few ties. Don’t worry, they haven’t totally lost their minds. They’ve got Damian Lillard ranked number 4 for Western Conference Guards, tied with Klay Thompson. Klay’s an interesting case, because though he’s definitely got the fans and media behind him, he’s only ranked 11th by his peers.
It’s not surprising that we see Nowitzki in all three. Dude’s a legend, playing at 41, and this is a “sentimental” pick on a lot of levels. DLo (D’Angelo Russell) is another story, though. I’m not saying he doesn’t deserve it — he’s been great this season, but (if you take a look at the table above for Eastern Backcourt), by votes alone, the players, fans, and media all had several players lined up before him.
Based on the votes of their peers, who was low-key robbed?
We’ll grab the top seven players from each segment according to player rankings. Then we can see who among them was not selected to play in the All-Star Game.
I like this little not in operator %ni%, from a post on Stack Overflow by Spencer Castro.4 So, I’ll use that to get my player list.
'%ni%' <- Negate('%in%')
player_top7 <- asg_votes %>%
filter(player_rank <= 7)
top7_nin_asg <- player_top7 %>%
filter(player %ni% asg_players$player)
| Top players by player votes not on All-Star Roster | ||||||
|---|---|---|---|---|---|---|
| NBA All-Star Voting 2019 Results | ||||||
| Player Name | Team | Fan Rank | Player Rank | Media Rank | Weighted Score | |
| Jimmy Butler | PHI | 5 | 4 | 7 | 5.25 | |
| Derrick Rose | MIN | 2 | 4 | 6 | 3.50 | |
| Andre Drummond | DET | 12 | 6 | 7 | 9.25 | |
| Devin Booker | PHX | 10 | 6 | 6 | 8.00 | |
| Jayson Tatum | BOS | 4 | 7 | 4 | 4.75 | |
| Steven Adams | OKC | 6 | 7 | 8 | 6.75 | |
| Jamal Murray | DEN | 13 | 7 | 6 | 9.75 | |
| source: nba.com | ||||||
Looks like Jimmy Butler and Derrick Rose were robbed from players’ standpoint.
Lest you think everyone was in agreement about that, the media were a pretty consistent voting block, and, the way rankings were done, this means players with zero media votes all tied for… Well, let’s see:
asg_votes %>%
group_by(conf_court) %>%
filter(media_rank == max(media_rank)) %>%
select(media_total_votes, media_rank, conf_court) %>%
distinct() %>%
gt() %>%
tab_header(
title = md("**Media All-Star No Votes and Rank**"),
subtitle = glue::glue("NBA All-Star Voting 2019 Results")
) %>%
cols_label(
media_total_votes = md("**Media Votes**"),
media_rank = md("**Media Rank**")
) %>%
tab_source_note(md("source: [nba.com](http://www.nba.com/article/2019/01/24/2019-nba-all-star-starters-revealed-official-release)")) %>%
tab_options(stub_group.font.weight = "600",
sourcenote.padding = px(10))
| Media All-Star No Votes and Rank | ||
|---|---|---|
| NBA All-Star Voting 2019 Results | ||
| Media Votes | Media Rank | |
| eastern frontcourt | ||
| 0 | 7 | |
| eastern backcourt | ||
| 0 | 8 | |
| western frontcourt | ||
| 0 | 8 | |
| western backcourt | ||
| 0 | 8 | |
| source: nba.com | ||
So, yeah, Jimmy Butler was 7th in media rank…along with every other frontcourt player from the Eastern Conference who got zero media votes.
The conference captains, LeBron James and Giannis Antetokounmpo, drafted their teams on February 8th. Here’s how that shook out:
allstar_teams <- read_csv(here::here("data", "ASG", "allstar_teams.csv"))
## Parsed with column specification:
## cols(
## draft_pick = col_double(),
## player = col_character(),
## allstar_team = col_character()
## )
asg_player_teamslug <- asg_data %>%
dplyr::select(player, team_slug)
allstar_teams %>%
left_join(asg_player_teamslug, by = "player") %>%
gt() %>%
tab_header(
title = md("**Draft Results: Team LeBron vs. Team Giannis**"),
subtitle = glue::glue("2019 NBA All-Star Rosters")
) %>%
cols_label(
draft_pick = md("**Pick**"),
player = md("**Player**"),
allstar_team = md("**All-Star Team**"),
team_slug = md("**NBA Team**")
) %>%
tab_source_note(md("source: [nba.com](http://www.nba.com/allstar/2019/draft)")) %>%
tab_footnote(
footnote = "Traded after draft",
locations = cells_data(
columns = vars(player),
rows = c(13, 16))
) %>%
tab_options(footnote.glyph = c("*, †, ‡"))
| Draft Results: Team LeBron vs. Team Giannis | ||||
|---|---|---|---|---|
| 2019 NBA All-Star Rosters | ||||
| Pick | Player | All-Star Team | NBA Team | |
| 1 | Kevin Durant | Team LeBron | GSW | |
| 2 | Stephen Curry | Team Giannis | GSW | |
| 3 | Kyrie Irving | Team LeBron | BOS | |
| 4 | Joel Embiid | Team Giannis | PHI | |
| 5 | Kawhi Leonard | Team LeBron | TOR | |
| 6 | Paul George | Team Giannis | OKC | |
| 7 | James Harden | Team LeBron | HOU | |
| 8 | Kemba Walker | Team Giannis | CHA | |
| 9 | Khris Middleton | Team Giannis | MIL | |
| 10 | Anthony Davis | Team LeBron | NOP | |
| 11 | Nikola Jokic | Team Giannis | DEN | |
| 12 | Klay Thompson | Team LeBron | GSW | |
| 13 | Ben Simmons* | Team Giannis | PHI | |
| 14 | Damian Lillard | Team LeBron | POR | |
| 15 | Blake Griffin | Team Giannis | DET | |
| 16 | Russell Westbrook* | Team LeBron | OKC | |
| 17 | D’Angelo Russell | Team Giannis | NA | |
| 18 | LaMarcus Aldridge | Team LeBron | SAS | |
| 19 | Nikola Vucevic | Team Giannis | ORL | |
| 20 | Karl-Anthony Towns | Team LeBron | MIN | |
| 21 | Kyle Lowry | Team Giannis | TOR | |
| 22 | Bradley Beal | Team LeBron | WAS | |
| 23 | Dwyane Wade | Team LeBron | MIA | |
| 24 | Dirk Nowitzki | Team Giannis | DAL | |
| source: nba.com | ||||
| * Traded after draft | ||||
Since there are no rules prohibiting trades (this is only the second year the NBA has drafted all-star teams rather than splitting them by conference), Giannis and LeBron went ahead and swapped Ben Simmons and Russell Westbrook after the draft.5
allstar_results <- read_csv(here::here("data", "ASG", "allstar_results.csv"))
## Parsed with column specification:
## cols(
## player = col_character(),
## allstar_team = col_character(),
## starter = col_logical()
## )
allstar_results %>%
left_join(asg_player_teamslug, by = "player") %>%
mutate(status = case_when(
starter == TRUE ~ "Starters",
TRUE ~ "Reserves"
)) %>%
dplyr::select(player, allstar_team, status, team_slug) %>%
group_by(allstar_team, status) %>%
gt(rowname_col = "player") %>%
tab_header(
title = md("**2019 NBA All-Star Teams**")
) %>%
cols_label(
team_slug = md("**NBA Team**")
) %>%
tab_source_note(md("source: [nba.com](http://www.nba.com/allstar/2019/draft)")) %>%
tab_options(
stub_group.font.weight = "600"
)
| 2019 NBA All-Star Teams | ||
|---|---|---|
| NBA Team | ||
| Team LeBron - Starters | ||
| LeBron James | LAL | |
| Kevin Durant | GSW | |
| Kyrie Irving | BOS | |
| Kawhi Leonard | TOR | |
| James Harden | HOU | |
| Team Giannis - Starters | ||
| Giannis Antetokounmpo | MIL | |
| Stephen Curry | GSW | |
| Joel Embiid | PHI | |
| Paul George | OKC | |
| Kemba Walker | CHA | |
| Team Giannis - Reserves | ||
| Khris Middleton | MIL | |
| Nikola Jokic | DEN | |
| Blake Griffin | DET | |
| Russell Westbrook | OKC | |
| D'Angelo Russell | BKN | |
| Nikola Vucevic | ORL | |
| Kyle Lowry | TOR | |
| Dirk Nowitzki | DAL | |
| Team LeBron - Reserves | ||
| Anthony Davis | NOP | |
| Klay Thompson | GSW | |
| Ben Simmons | PHI | |
| Damian Lillard | POR | |
| LaMarcus Aldridge | SAS | |
| Karl-Anthony Towns | MIN | |
| Bradley Beal | WAS | |
| Dwyane Wade | MIA | |
| source: nba.com | ||
allstar_spread <- allstar_results %>%
tibble::rowid_to_column() %>%
spread(allstar_team, player) %>%
mutate(status = case_when(
starter == TRUE ~ "Starters",
TRUE ~ "Reserves"
)) %>%
dplyr::select(status, `Team Giannis`, `Team LeBron`)
team_giannis <- allstar_spread %>%
filter(!is.na(`Team Giannis`)) %>%
dplyr::select(status, `Team Giannis`)
team_lebron <- allstar_spread %>%
filter(!is.na(`Team LeBron`)) %>%
dplyr::select(status, `Team LeBron`)
spread_teams <- team_giannis %>%
bind_cols(team_lebron) %>%
select(-status1)
spread_teams %>%
group_by(status) %>%
gt() %>%
cols_label(`Team Giannis` = html("<strong>Team Giannis</strong>",
web_image(url = "https://abs.twimg.com/hashflags/TeamGiannis-ASW19/TeamGiannis-ASW19.png")
),
`Team LeBron` = html("<strong>Team LeBron</strong>",
web_image(url = "https://abs.twimg.com/hashflags/TeamLBJ-ASW19/TeamLBJ-ASW19.png")
)
) %>%
tab_header(
title = html(
"<strong>2019 NBA All-Star Teams</strong>",
web_image(
url = "https://abs.twimg.com/hashflags/NBAAllstarMain2019/NBAAllstarMain2019.png"
)
)
) %>%
tab_options(
table.background.color = "darkcyan",
column_labels.font.weight = "600",
stub_group.font.weight = "800"
) %>%
tab_style(
style = cells_styles(
text_font = "Georgia",
text_size = pt(80)
),
locations = cells_title(
groups = c("title")
)
) %>%
tab_style(
style = cells_styles(
text_align = "center"
),
locations = cells_group(status)
)
2019 NBA All-Star Teams ![]() |
|
|---|---|
Team Giannis ![]() |
Team LeBron ![]() |
| Starters | |
| Giannis Antetokounmpo | LeBron James |
| Stephen Curry | Kevin Durant |
| Joel Embiid | Kyrie Irving |
| Paul George | Kawhi Leonard |
| Kemba Walker | James Harden |
| Reserves | |
| Khris Middleton | Anthony Davis |
| Nikola Jokic | Klay Thompson |
| Blake Griffin | Ben Simmons |
| Russell Westbrook | Damian Lillard |
| D'Angelo Russell | LaMarcus Aldridge |
| Nikola Vucevic | Karl-Anthony Towns |
| Kyle Lowry | Bradley Beal |
| Dirk Nowitzki | Dwyane Wade |
How about we take a look at those pretty hashflags they’ve got going on Twitter for All-Star Weekend? Since Twitter apparently doesn’t know how to follow a naming convention, I manually populated a spreadsheet with the necessary info.
allstar_hashflags <- readr::read_csv(here::here("data", "ASG", "allstar_hashflags.csv"))
## Parsed with column specification:
## cols(
## player = col_character(),
## allstar_team = col_character(),
## starter = col_logical(),
## hashflag = col_character(),
## hashflag_url = col_character()
## )
allstar_hashflags %>%
mutate(status = case_when(
starter == TRUE ~ "Starters",
TRUE ~ "Reserves"
)) %>%
dplyr::select(player, allstar_team, status, hashflag_url) %>%
group_by(allstar_team, status) %>%
gt(rowname_col = "player") %>%
text_transform(
locations = cells_data(vars(hashflag_url)),
fn = function(x) {
web_image(url = x)
}
) %>%
tab_header(
title = html(
"<strong>2019 NBA All-Star Teams</strong>",
web_image(
url = "https://abs.twimg.com/hashflags/NBAAllstarMain2019/NBAAllstarMain2019.png"
)
)
) %>%
cols_label(
hashflag_url = md("**Hashflag**")
) %>%
tab_options(
stub_group.font.weight = "600",
row.striping.include_stub = TRUE,
table.width = pct(40)
) %>%
tab_style(
locations = cells_data(vars(hashflag_url)),
cells_styles(text_align = "center")
)
2019 NBA All-Star Teams ![]() |
|
|---|---|
| Hashflag | |
| Team LeBron - Starters | |
| LeBron James | ![]() |
| Kevin Durant | ![]() |
| Kyrie Irving | ![]() |
| Kawhi Leonard | ![]() |
| James Harden | ![]() |
| Team Giannis - Starters | |
| Giannis Antetokounmpo | ![]() |
| Stephen Curry | ![]() |
| Joel Embiid | ![]() |
| Paul George | ![]() |
| Kemba Walker | ![]() |
| Team Giannis - Reserves | |
| Khris Middleton | ![]() |
| Nikola Jokic | ![]() |
| Blake Griffin | ![]() |
| Russell Westbrook | ![]() |
| D’Angelo Russell | ![]() |
| Nikola Vucevic | ![]() |
| Kyle Lowry | ![]() |
| Dirk Nowitzki | ![]() |
| Team LeBron - Reserves | |
| Anthony Davis | ![]() |
| Klay Thompson | ![]() |
| Ben Simmons | ![]() |
| Damian Lillard | ![]() |
| LaMarcus Aldridge | ![]() |
| Karl-Anthony Towns | ![]() |
| Bradley Beal | ![]() |
| Dwyane Wade | ![]() |
asw_giannis <- allstar_hashflags %>%
filter(allstar_team == "Team Giannis")
asw_giannis %>%
mutate(status = case_when(
starter == TRUE ~ "Starters",
TRUE ~ "Reserves"
)) %>%
dplyr::select(player, status, hashflag_url) %>%
group_by(status) %>%
gt(rowname_col = "player") %>%
text_transform(
locations = cells_data(vars(hashflag_url)),
fn = function(x) {
web_image(url = x)
}
) %>%
tab_header(
title = html(
"<strong>Team Giannis</strong>",
web_image(
url = "https://abs.twimg.com/hashflags/TeamGiannis-ASW19/TeamGiannis-ASW19.png"
)
),
subtitle = md("2019 NBA All-Star Game")
) %>%
cols_label(
hashflag_url = md("**Hashflag**")
) %>%
tab_options(
stub_group.font.weight = "600",
row.striping.include_stub = TRUE,
table.width = px(300)
) %>%
tab_style(
locations = cells_data(vars(hashflag_url)),
cells_styles(text_align = "center")
)
Team Giannis ![]() |
|
|---|---|
| 2019 NBA All-Star Game | |
| Hashflag | |
| Starters | |
| Giannis Antetokounmpo | ![]() |
| Stephen Curry | ![]() |
| Joel Embiid | ![]() |
| Paul George | ![]() |
| Kemba Walker | ![]() |
| Reserves | |
| Khris Middleton | ![]() |
| Nikola Jokic | ![]() |
| Blake Griffin | ![]() |
| Russell Westbrook | ![]() |
| D’Angelo Russell | ![]() |
| Nikola Vucevic | ![]() |
| Kyle Lowry | ![]() |
| Dirk Nowitzki | ![]() |
asw_lebron <- allstar_hashflags %>%
filter(allstar_team == "Team LeBron")
asw_lebron %>%
mutate(status = case_when(
starter == TRUE ~ "Starters",
TRUE ~ "Reserves"
)) %>%
dplyr::select(player, status, hashflag_url) %>%
group_by(status) %>%
gt(rowname_col = "player") %>%
text_transform(
locations = cells_data(vars(hashflag_url)),
fn = function(x) {
web_image(url = x)
}
) %>%
tab_header(
title = html(
"<strong>Team LeBron</strong>",
web_image(
url = "https://abs.twimg.com/hashflags/TeamLBJ-ASW19/TeamLBJ-ASW19.png"
)
),
subtitle = md("2019 NBA All-Star Game")
) %>%
cols_label(
hashflag_url = md("**Hashflag**")
) %>%
tab_options(
stub_group.font.weight = "600",
row.striping.include_stub = TRUE,
table.width = px(300)
) %>%
tab_style(
locations = cells_data(vars(hashflag_url)),
cells_styles(text_align = "center")
)
Team LeBron ![]() |
|
|---|---|
| 2019 NBA All-Star Game | |
| Hashflag | |
| Starters | |
| LeBron James | ![]() |
| Kevin Durant | ![]() |
| Kyrie Irving | ![]() |
| Kawhi Leonard | ![]() |
| James Harden | ![]() |
| Reserves | |
| Anthony Davis | ![]() |
| Klay Thompson | ![]() |
| Ben Simmons | ![]() |
| Damian Lillard | ![]() |
| LaMarcus Aldridge | ![]() |
| Karl-Anthony Towns | ![]() |
| Bradley Beal | ![]() |
| Dwyane Wade | ![]() |
“Nets’ Russell replaces injured Oladipo in All-Star Game” http://www.nba.com/article/2019/02/01/dangelo-russell-replaces-victor-oladipo-all-star-roster↩
“Wade, Nowitzki named special roster additions for All-Star Game” http://www.nba.com/article/2019/02/01/dirk-nowitzki-dwyane-wade-added-all-star-game↩
“NBA All-Star Games: Votes” http://rpubs.com/maraaverick/nba-asg-votes-2019↩
“Opposite of %in%” https://stackoverflow.com/questions/5831794/opposite-of-in↩