Scrape NFL weekly outcomes by week

scrape_nfl_weekly_standings(season = 2020, tidy = FALSE)

Arguments

season

character or numeric - greater than 1990

tidy

logical - either TRUE to stack data by game/week or FALSE to return table as is

Value

tibble

Examples

# Here we run w/ tidy = FALSE to get the exact table from PFR scrape_nfl_weekly_standings(season = 2020, tidy = FALSE)
#> Scraping standings from 2020!
#> # A tibble: 269 × 16 #> game_num season week day date time winner_tie home_team loser_tie #> <int> <int> <chr> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 1 2020 1 Thu 2020-09-10 8:20PM Kansas Cit… "" Houston … #> 2 2 2020 1 Sun 2020-09-13 1:00PM Seattle Se… "@" Atlanta … #> 3 3 2020 1 Sun 2020-09-13 1:00PM Buffalo Bi… "" New York… #> 4 4 2020 1 Sun 2020-09-13 1:00PM Washington… "" Philadel… #> 5 5 2020 1 Sun 2020-09-13 1:00PM Green Bay … "@" Minnesot… #> 6 6 2020 1 Sun 2020-09-13 1:00PM Baltimore … "" Clevelan… #> 7 7 2020 1 Sun 2020-09-13 1:00PM New Englan… "" Miami Do… #> 8 8 2020 1 Sun 2020-09-13 1:00PM Jacksonvil… "" Indianap… #> 9 9 2020 1 Sun 2020-09-13 1:00PM Las Vegas … "@" Carolina… #> 10 10 2020 1 Sun 2020-09-13 1:00PM Chicago Be… "@" Detroit … #> # … with 259 more rows, and 7 more variables: pts_winner <dbl>, #> # pts_loser <dbl>, yds_winner <dbl>, turnovers_winner <dbl>, yds_loser <dbl>, #> # turnovers_loser <dbl>, winner <dbl>
# Here we scrape the outcome and stack the games on top of eachother scrape_nfl_weekly_standings(season = 2020, tidy = TRUE)
#> Scraping standings from 2020!
#> # A tibble: 538 × 13 #> game_num season week day date time team home_team points yards #> <int> <int> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> #> 1 1 2020 1 Thu 2020-09-10 8:20PM Kansas … 1 34 369 #> 2 2 2020 1 Sun 2020-09-13 1:00PM Seattle… 0 38 383 #> 3 3 2020 1 Sun 2020-09-13 1:00PM Buffalo… 1 27 404 #> 4 4 2020 1 Sun 2020-09-13 1:00PM Washing… 1 27 239 #> 5 5 2020 1 Sun 2020-09-13 1:00PM Green B… 0 43 522 #> 6 6 2020 1 Sun 2020-09-13 1:00PM Baltimo… 1 38 381 #> 7 7 2020 1 Sun 2020-09-13 1:00PM New Eng… 1 21 357 #> 8 8 2020 1 Sun 2020-09-13 1:00PM Jackson… 1 27 241 #> 9 9 2020 1 Sun 2020-09-13 1:00PM Las Veg… 0 34 372 #> 10 10 2020 1 Sun 2020-09-13 1:00PM Chicago… 0 27 363 #> # … with 528 more rows, and 3 more variables: turnovers <dbl>, winner <dbl>, #> # playoffs <dbl>