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 2022-02-08 14:15:31 with ep model version "v1.0.0"
#> # A tibble: 10 × 47
#>    game_id     play_id desc  rusher_player_id full_name posteam two_point_attem…
#>    <chr>         <dbl> <chr> <chr>            <chr>     <chr>              <dbl>
#>  1 2006_01_AT…      58 (14:… 00-0004640       Warrick … ATL                    0
#>  2 2006_01_AT…      80 (14:… 00-0004640       Warrick … ATL                    0
#>  3 2006_01_AT…     183 (12:… 00-0004640       Warrick … ATL                    0
#>  4 2006_01_AT…     227 (11:… 00-0004640       Warrick … ATL                    0
#>  5 2006_01_AT…     336 (10:… 00-0021164       DeShaun … CAR                    0
#>  6 2006_01_AT…     406 (8:5… 00-0021164       DeShaun … CAR                    0
#>  7 2006_01_AT…     625 (6:2… 00-0004640       Warrick … ATL                    0
#>  8 2006_01_AT…     647 (5:4… 00-0020245       Mike Vick ATL                    0
#>  9 2006_01_AT…     674 (5:1… 00-0004640       Warrick … ATL                    0
#> 10 2006_01_AT…     696 (4:3… 00-0004640       Warrick … ATL                    0
#> # … with 40 more variables: two_point_converted <dbl>, rush_attempt <dbl>,
#> #   first_down_rush <dbl>, fumble_lost <dbl>, season <dbl>, 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>, …
# }