Skip to contents

This function downloads precomputed expected points data from the ffopportunity automated releases.

Usage

ep_load(
  season = nflreadr::most_recent_season(),
  type = c("weekly", "pbp_pass", "pbp_rush"),
  version = c("latest", "v1.0.0")
)

Arguments

season

A numeric vector of four digit years associated with given NFL seasons - defaults to latest season.

type

Data type - one of "weekly", "pbp_pass", or "pbp_rush"

version

EP model version: one of "latest" (default) or "v1.0.0" - these are currently identical.

Value

a dataframe identical to what would be returned by ffopportunity::ep_build() for a given season.

See also

Other main: ep_build()

Examples

# \donttest{
try({
  ep_load() %>% head(10)
  ep_load(2020:2021) %>% head(10)
  ep_load(2021, type = "pbp_pass") %>% head(10)
  ep_load(2006, type = "pbp_rush", version = "v1.0.0") %>% head(10)
})
#> → <ffopportunity predictions>
#> → Generated 2024-08-09 03:20:21.885727 with ep model version "v1.0.0"
#> # A tibble: 10 × 50
#>    game_id    play_id desc  rusher_player_id full_name posteam two_point_attempt
#>    <chr>        <dbl> <chr> <chr>            <chr>     <chr>               <dbl>
#>  1 2006_01_A…      58 (14:… 00-0004640       Warrick … ATL                     0
#>  2 2006_01_A…      80 (14:… 00-0004640       Warrick … ATL                     0
#>  3 2006_01_A…     183 (12:… 00-0004640       Warrick … ATL                     0
#>  4 2006_01_A…     227 (11:… 00-0004640       Warrick … ATL                     0
#>  5 2006_01_A…     336 (10:… 00-0021164       DeShaun … CAR                     0
#>  6 2006_01_A…     406 (8:5… 00-0021164       DeShaun … CAR                     0
#>  7 2006_01_A…     625 (6:2… 00-0004640       Warrick … ATL                     0
#>  8 2006_01_A…     647 (5:4… 00-0020245       Michael … ATL                     0
#>  9 2006_01_A…     674 (5:1… 00-0004640       Warrick … ATL                     0
#> 10 2006_01_A…     696 (4:3… 00-0004640       Warrick … ATL                     0
#> # ℹ 43 more variables: two_point_converted <dbl>, rush_attempt <dbl>,
#> #   first_down_rush <dbl>, fumble_lost <dbl>, season <int>, week <int>,
#> #   rushing_yards <dbl>, rush_touchdown <fct>, first_down <fct>,
#> #   posteam_type <chr>, run_location <chr>, run_gap <chr>, run_gap_dir <chr>,
#> #   surface <chr>, wind <int>, temp <int>, roof <chr>, position <chr>,
#> #   yardline_100 <dbl>, half_seconds_remaining <dbl>,
#> #   game_seconds_remaining <dbl>, fixed_drive <dbl>, era <chr>, xpass <dbl>, …
# }