Please note that the column names are identical between offense/defense and you should reference the 'role' column for offensive or defensive stats.

scrape_team_stats_nfl(season = 2019, stats = "passing", role = "offense")

Arguments

season

character or numeric - greater than 1971, note that some data is missing for earlier seasons.

stats

character - either "passing", "rushing", "receiving", "scoring", "downs"

role

character - "offense" or "defense"

Value

tibble

Examples

# Get the NFL.com game-level stats for offense in 2018 scrape_team_stats_nfl(season = 2018, stats = "passing", role = "offense")
#> Scraping passing for offense from 2018!
#> # A tibble: 32 × 19 #> season role stat team pass_att pass_comp pass_comp_pct yds_att pass_yds #> <int> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <int> #> 1 2018 OFFENSE PASSING Reds… 509 311 0.611 6.5 3287 #> 2 2018 OFFENSE PASSING Bucc… 625 408 0.653 8.6 5358 #> 3 2018 OFFENSE PASSING Seah… 427 280 0.656 8.1 3448 #> 4 2018 OFFENSE PASSING 49ers 532 331 0.622 8 4247 #> 5 2018 OFFENSE PASSING Char… 512 348 0.68 8.4 4316 #> 6 2018 OFFENSE PASSING Stee… 689 459 0.666 7.5 5174 #> 7 2018 OFFENSE PASSING Card… 495 283 0.572 5.8 2884 #> 8 2018 OFFENSE PASSING Eagl… 599 422 0.705 7.6 4524 #> 9 2018 OFFENSE PASSING Jets 524 299 0.571 6.5 3404 #> 10 2018 OFFENSE PASSING Gian… 583 382 0.655 7.6 4405 #> # … with 22 more rows, and 10 more variables: pass_td <int>, int <int>, #> # pass_rating <dbl>, first_downs <int>, pass_first_pct <dbl>, #> # pass_20plus <int>, pass_40plus <int>, pass_long <chr>, sacks <int>, #> # sack_yds <int>
# Get the NFL.com team-level passing stats for defense in 2014 scrape_team_stats_nfl(season = "2014", stats = "rushing", role = "defense")
#> Scraping rushing for defense from 2014!
#> # A tibble: 32 × 14 #> season role stat team rush_att rush_yds rush_ypc rush_td rush_20plus #> <int> <chr> <chr> <chr> <int> <int> <dbl> <int> <int> #> 1 2014 DEFENSE RUSHING Redskins 421 1722 4.1 11 9 #> 2 2014 DEFENSE RUSHING Buccaneers 468 1819 3.9 15 10 #> 3 2014 DEFENSE RUSHING Seahawks 380 1304 3.4 8 7 #> 4 2014 DEFENSE RUSHING 49ers 402 1612 4 7 10 #> 5 2014 DEFENSE RUSHING Chargers 438 1986 4.5 11 12 #> 6 2014 DEFENSE RUSHING Steelers 368 1605 4.4 9 11 #> 7 2014 DEFENSE RUSHING Cardinals 396 1739 4.4 9 13 #> 8 2014 DEFENSE RUSHING Eagles 473 1771 3.7 14 9 #> 9 2014 DEFENSE RUSHING Jets 393 1489 3.8 10 7 #> 10 2014 DEFENSE RUSHING Giants 438 2162 4.9 15 17 #> # … with 22 more rows, and 5 more variables: rush_40plus <int>, rush_lng <chr>, #> # rush_first <int>, rush_first_pct <dbl>, rush_fum <int>