Skip to content

Commit

Permalink
include half sacks and corresponding yards
Browse files Browse the repository at this point in the history
also invert yards here as it's the defense player stat
  • Loading branch information
mrcaseb committed Jul 3, 2024
1 parent 1b1f831 commit 6f614c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/calculate_stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ calculate_stats <- function(seasons = nflreadr::most_recent_season(),
def_tackles_for_loss = sum(stat_id == 402),
def_tackles_for_loss_yards = sum((stat_id == 402) * yards),
def_fumbles_forced = sum(stat_id == 91),
def_sacks = sum(stat_id == 83),
def_sack_yards = sum((stat_id == 83) * yards),
def_sacks = sum(stat_id == 83) + 1 / 2 * sum(stat_id == 84),
def_sack_yards = sum((stat_id == 83) * -yards) + 1 / 2 * sum((stat_id == 84) * -yards),
def_qb_hits = sum(stat_id == 110),
def_interceptions = sum(stat_id %in% 25:26),
def_interception_yards = sum((stat_id %in% 25:28) * yards),
Expand Down

0 comments on commit 6f614c2

Please sign in to comment.