Skip to content

Commit

Permalink
fix participation for relocated teams, resolve #80 (#81)
Browse files Browse the repository at this point in the history
* resolve #80

* Update update_pbp_participation.R
  • Loading branch information
john-b-edwards authored Aug 8, 2023
1 parent 66e8dde commit 818bf2c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions R/update_pbp_participation.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ pbp_participation <-
number_of_pass_rushers,
players_on_play
) |>
# oak -> lv exception
dplyr::mutate(tmp_possession_team = nflreadr::clean_team_abbrs(possession_team, current_location = TRUE, keep_non_matches = TRUE)) |>
dplyr::summarise(
offense_players = gsis_id[possession_team == team] |> na.omit() |> paste(collapse = ";"),
n_offense = gsis_id[possession_team == team] |> na.omit() |> length(),
defense_players = gsis_id[possession_team != team] |> na.omit() |> paste(collapse = ";"),
n_defense = gsis_id[possession_team != team] |> na.omit() |> length(),
offense_players = gsis_id[tmp_possession_team == team] |> na.omit() |> paste(collapse = ";"),
n_offense = gsis_id[tmp_possession_team == team] |> na.omit() |> length(),
defense_players = gsis_id[tmp_possession_team != team] |> na.omit() |> paste(collapse = ";"),
n_defense = gsis_id[tmp_possession_team != team] |> na.omit() |> length(),
.groups = "drop"
) |>
dplyr::ungroup() |>
Expand Down

0 comments on commit 818bf2c

Please sign in to comment.