Skip to content

Commit

Permalink
sum air yards of all targets, not only completions
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcaseb committed Dec 3, 2024
1 parent d07f9a7 commit ba00e9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/calculate_stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ calculate_stats <- function(seasons = nflreadr::most_recent_season(),
# cannot appear more than once per play.
# If this ever changes, we can use pbp instead.
receiving_air_yards = if (.env$stat_type == "player"){
sum( (stat_id %in% 21:22) * .data$team_play_air_yards )
sum( (stat_id == 115) * .data$team_play_air_yards )
} else .data$passing_air_yards,
receiving_yards_after_catch = sum((stat_id == 113) * yards),
receiving_first_downs = sum((stat_id %in% 21:22) & has_id(4, team_stats)),
Expand Down

0 comments on commit ba00e9e

Please sign in to comment.