Skip to content

Commit

Permalink
rushing/receiving yards and tds should include the stat ids for laterals
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcaseb committed Jul 2, 2024
1 parent 0a01a16 commit 1b1f831
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/calculate_stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ calculate_stats <- function(seasons = nflreadr::most_recent_season(),
# dakota = ,

carries = sum(stat_id %in% 10:11),
rushing_yards = sum((stat_id %in% 10:11) * yards),
rushing_tds = sum(stat_id == 11),
rushing_yards = sum((stat_id %in% 10:13) * yards),
rushing_tds = sum(stat_id %in% c(11,13)),
rushing_fumbles = sum((stat_id %in% 10:11) & any(has_id(52, more_stats), has_id(53, more_stats), has_id(54, more_stats))),
rushing_fumbles_lost = sum((stat_id %in% 10:11) & has_id(106, more_stats)),
rushing_first_downs = sum((stat_id %in% 10:11) & has_id(3, team_stats)),
Expand All @@ -101,8 +101,8 @@ calculate_stats <- function(seasons = nflreadr::most_recent_season(),

receptions = sum(stat_id %in% 21:22),
targets = sum(stat_id == 115),
receiving_yards = sum((stat_id %in% 21:22) * yards),
receiving_tds = sum(stat_id == 22),
receiving_yards = sum((stat_id %in% 21:24) * yards),
receiving_tds = sum(stat_id %in% c(22,24)),
receiving_fumbles = sum((stat_id %in% 21:22) & any(has_id(52, more_stats), has_id(53, more_stats), has_id(54, more_stats))),
receiving_fumbles_lost = sum((stat_id %in% 21:22) & has_id(106, more_stats)),
# receiving_air_yards = that's in 111:112 but it is a passer stat not a receiver stat,
Expand Down

0 comments on commit 1b1f831

Please sign in to comment.