Skip to contents

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

Usage

load_ff_opportunity(
  seasons = most_recent_season(),
  stat_type = c("weekly", "pbp_pass", "pbp_rush"),
  model_version = c("latest", "v1.0.0")
)

Arguments

seasons

a numeric vector of seasons to return, defaults to most recent season. If set to TRUE, returns all available data.

stat_type

one of "weekly", "pbp_pass", "pbp_rush"

model_version

one of "latest" or "v1.0.0"

Value

Precomputed expected fantasy points data from the ffopportunity automated releases.

See also

https://ffopportunity.ffverse.com for more on the package, data, and modelling

https://nflreadr.nflverse.com/articles/dictionary_ff_opportunity.html for the web data dictionary

dictionary_ff_opportunity for the data dictionary bundled as a package data frame

Issues with this data should be filed here: https://github.com/ffverse/ffopportunity

Examples

# \donttest{
  try({ # prevents cran errors
  load_ff_opportunity()
  load_ff_opportunity(seasons = 2021, stat_type = "pbp_pass", model_version = "v1.0.0")
  })
#> ── nflverse ffopportunity expected points: pbp_pass ────────────────────────────
#>  Data updated: 2022-09-28 20:20:36 UTC
#> # A tibble: 19,613 × 57
#>    game_id play_id desc  passe…¹ passe…² passe…³ recei…⁴ recei…⁵ recei…⁶ posteam
#>    <chr>     <dbl> <chr> <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr>  
#>  1 2021_0…      76 (14:… 00-002… Ryan T… QB      00-003… Derric… RB      TEN    
#>  2 2021_0…     100 (13:… 00-002… Ryan T… QB      00-003… Cheste… WR      TEN    
#>  3 2021_0…     152 (13:… 00-003… Kyler … QB      00-003… DeAndr… WR      ARI    
#>  4 2021_0…     218 (12:… 00-003… Kyler … QB      00-003… Chase … RB      ARI    
#>  5 2021_0…     253 (11:… 00-003… Kyler … QB      00-002… A.J. G… WR      ARI    
#>  6 2021_0…     386 (10:… 00-003… Kyler … QB      00-003… Christ… WR      ARI    
#>  7 2021_0…     410 (9:2… 00-003… Kyler … QB      00-003… Rondal… WR      ARI    
#>  8 2021_0…     599 (8:3… 00-003… Kyler … QB      00-002… A.J. G… WR      ARI    
#>  9 2021_0…     621 (8:2… 00-003… Kyler … QB      00-003… Demetr… TE      ARI    
#> 10 2021_0…     660 (8:1… 00-003… Kyler … QB      00-003… DeAndr… WR      ARI    
#> # … with 19,603 more rows, 47 more variables: two_point_attempt <dbl>,
#> #   two_point_converted <dbl>, pass_attempt <dbl>, receiving_yards <dbl>,
#> #   first_down_pass <dbl>, fumble_lost <dbl>, season <dbl>, week <int>,
#> #   complete_pass <fct>, yards_after_catch <dbl>, pass_touchdown <fct>,
#> #   first_down <fct>, interception <fct>, relative_to_endzone <dbl>,
#> #   wind <int>, score_differential <dbl>, xpass <dbl>, vegas_wp <dbl>,
#> #   total_line <dbl>, implied_total <dbl>, relative_to_sticks <dbl>, …
# }