Scrape NFL standings for a specific season from ESPN's site

scrape_nfl_standings(season, add_superbowls = FALSE)

Arguments

season

Either numeric or character

add_superbowls

Join superbowl winners (appropriate for historical data or after season over)

Value

Returns a tibble

Examples

# Get standings from 2018 season scrape_nfl_standings(season = "2018")
#> Scraping 2018
#> # A tibble: 32 × 20 #> team team_abb season conf_name conf_rank w l t pct home away #> <chr> <chr> <int> <chr> <int> <int> <int> <int> <dbl> <chr> <chr> #> 1 KC KC 2018 AFC 1 12 4 0 0.75 7-1 5-3 #> 2 LAC LAC 2018 AFC 2 12 4 0 0.75 5-3 7-1 #> 3 NE NE 2018 AFC 3 11 5 0 0.688 8-0 3-5 #> 4 HOU HOU 2018 AFC 4 11 5 0 0.688 6-2 5-3 #> 5 BAL BAL 2018 AFC 5 10 6 0 0.625 6-2 4-4 #> 6 IND IND 2018 AFC 6 10 6 0 0.625 6-2 4-4 #> 7 PIT PIT 2018 AFC 7 9 6 1 0.594 5-3 4-3-1 #> 8 TEN TEN 2018 AFC 8 9 7 0 0.563 6-2 3-5 #> 9 CLE CLE 2018 AFC 9 7 8 1 0.469 5-2-1 2-6 #> 10 MIA MIA 2018 AFC 10 7 9 0 0.438 6-2 1-7 #> # … with 22 more rows, and 9 more variables: div <chr>, conf <chr>, pf <int>, #> # pa <int>, diff <int>, strk <chr>, playoffs <chr>, playoff_rank <chr>, #> # team_logo <glue>
# Get standings from 2010 season scrape_nfl_standings(2000, add_superbowls = TRUE)
#> Scraping 2000
#> Adding Superbowls!
#> Error: Problem with `mutate()` column `sb_points`. #> `sb_points = as.integer(substr(sb_scores, 1, 2))`. #> `sb_points` must be size 55 or 1, not 0.