Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PBP Scores are off esp. in 2022 #466

Closed
mrcaseb opened this issue May 4, 2024 · 2 comments · Fixed by #467
Closed

PBP Scores are off esp. in 2022 #466

mrcaseb opened this issue May 4, 2024 · 2 comments · Fixed by #467

Comments

@mrcaseb
Copy link
Member

mrcaseb commented May 4, 2024

image

@mrcaseb
Copy link
Member Author

mrcaseb commented May 4, 2024

Example code, no reprex but working on my local machine

pbp_db |> 
  group_by(game_id) |> 
  summarise(
    away_score = last(away_score),
    home_score = last(home_score),
    away_pbp = last(total_away_score),
    home_pbp = last(total_home_score),
    season = last(season)
  ) |> 
  mutate(
    away_wrong = away_score != away_pbp,
    home_wrong = home_score != home_pbp,
  ) |> 
  filter(
    away_wrong == TRUE | home_wrong == TRUE
  ) |> 
  arrange(game_id) |> 
  collect() |> 
  group_by(season) |> 
  gt() |> 
  cols_label(
    contains("away") ~ "A",
    contains("home") ~ "H"
  ) |> 
  cols_hide(ends_with("wrong")) |> 
  gt_table_theme() |> 
  tab_spanner("Scores", contains("score")) |> 
  tab_spanner("PBP Scores", contains("pbp")) |> 
  cols_width(
    !contains("game_id") ~ px(40),
    TRUE ~ px(125)
  ) |> 
  tab_style(cell_borders("left"), locations = cells_body("away_pbp"))

@guga31bb
Copy link
Member

guga31bb commented May 6, 2024

Probably something dumb with return TDs again

@guga31bb guga31bb linked a pull request May 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants