Skip to contents

Loads participation data from the nflverse-data repository

Usage

load_participation(
  seasons = most_recent_season(),
  include_pbp = FALSE,
  file_type = getOption("nflreadr.prefer", default = "rds")
)

Arguments

seasons

A numeric vector of 4-digit years associated with given NFL seasons - defaults to latest season. If set to TRUE, returns all available data since 2016.

include_pbp

a logical: download and join pbp to this data?

file_type

One of c("rds", "qs", "csv", "parquet"). Can also be set globally with options(nflreadr.prefer)

Value

A dataframe of participation data, optionally merged with play by play

Examples

# \donttest{
try({ # prevents cran errors
  load_participation(seasons = 2020, include_pbp = TRUE)
})
#> ── nflverse play-by-play participation ─────────────────────────────────────────
#>  Data updated: 2022-09-13 15:07:16 UTC
#> # A tibble: 48,145 × 383
#>    nflverse_ga…¹ play_id posse…² offen…³ offen…⁴ defen…⁵ defen…⁶ numbe…⁷ playe…⁸
#>    <chr>           <int> <chr>   <chr>   <chr>     <int> <chr>     <int> <chr>  
#>  1 2020_01_ARI_…       1 ""      NA      NA           NA NA           NA ""     
#>  2 2020_01_ARI_…      39 "ARI"   NA      NA           NA NA           NA "45142…
#>  3 2020_01_ARI_…      54 "SF"    SHOTGUN 2 RB, …       7 2 DL, …       4 "40078…
#>  4 2020_01_ARI_…      93 "SF"    SHOTGUN 2 RB, …       7 2 DL, …      NA "40078…
#>  5 2020_01_ARI_…     118 "SF"    SINGLE… 2 RB, …       7 2 DL, …      NA "40078…
#>  6 2020_01_ARI_…     143 "SF"    SHOTGUN 2 RB, …       7 2 DL, …      NA "40078…
#>  7 2020_01_ARI_…     165 "SF"    SHOTGUN 1 RB, …       5 1 DL, …       4 "46078…
#>  8 2020_01_ARI_…     197 "SF"    NA      NA           NA NA           NA "46078…
#>  9 2020_01_ARI_…     226 "SF"    NA      NA           NA NA           NA "46203…
#> 10 2020_01_ARI_…     245 "ARI"   SHOTGUN 1 RB, …       5 4 DL, …       4 "42389…
#> # … with 48,135 more rows, 374 more variables: offense_players <chr>,
#> #   defense_players <chr>, n_offense <int>, n_defense <int>, old_game_id <chr>,
#> #   home_team <chr>, away_team <chr>, season_type <chr>, week <int>,
#> #   posteam <chr>, posteam_type <chr>, defteam <chr>, side_of_field <chr>,
#> #   yardline_100 <dbl>, game_date <chr>, quarter_seconds_remaining <dbl>,
#> #   half_seconds_remaining <dbl>, game_seconds_remaining <dbl>,
#> #   game_half <chr>, quarter_end <dbl>, drive <dbl>, sp <dbl>, qtr <dbl>, …
# }