Skip to contents

Loads season-level WNBA play-by-play (V3), supplied by wnba_pbp() in the upstream compile script. Backed by the wehoop-wnba-stats-data pipeline that publishes parquet/rds artifacts to the wnba_stats_pbp release tag.

load_wnba_stats_pbp_manifest() returns the per-season manifest CSV (season, row_count, generated_at_utc, source_endpoint) for the WNBA Stats play-by-play release tag without downloading any season's full data.

Usage

load_wnba_stats_pbp(
  seasons = most_recent_wnba_stats_season(),
  ...,
  dbConnection = NULL,
  tablename = NULL
)

load_wnba_stats_pbp_manifest()

Arguments

seasons

A vector of 4-digit years associated with given WNBA seasons. Published coverage runs 1997 through the most recent season, with no gaps. Pass seasons = TRUE for every published season. (Min: 1997)

...

Additional arguments passed to an underlying function that writes the season data into a database.

dbConnection

A DBIConnection object, as returned by DBI::dbConnect()

tablename

The name of the play-by-play data table within the database

Value

Returns a wehoop_data tibble of per-event play-by-play rows.

Examples

# \donttest{
  try(load_wnba_stats_pbp(seasons = most_recent_wnba_stats_season()))
#> ──────────────────────────────────────────────────────────────── wehoop 3.0.0 ──
#> # A tibble: 86,784 × 38
#>    order_index action_number clock       period   team_id team_tricode person_id
#>          <int>         <int> <chr>        <int>     <int> <chr>            <int>
#>  1           0             2 PT10M00.00S      1    0      ""              0     
#>  2           1             4 PT10M00.00S      1    1.61e9 "NYL"           1.63e6
#>  3           2             7 PT09M44.00S      1    1.61e9 "CON"           1.64e6
#>  4           3             8 PT09M39.00S      1    1.61e9 "NYL"           1.63e6
#>  5           4             9 PT09M25.00S      1    1.61e9 "NYL"           1.63e6
#>  6           5            11 PT09M17.00S      1    1.61e9 "CON"           1.64e6
#>  7           6            13 PT09M06.00S      1    1.61e9 "NYL"           1.63e6
#>  8           7            15 PT08M50.00S      1    1.61e9 "CON"           2.03e5
#>  9           8            16 PT08M50.00S      1    0      ""              1.61e9
#> 10           9            17 PT08M34.00S      1    1.61e9 "NYL"           1.63e6
#> # ℹ 86,774 more rows
#> # ℹ 31 more variables: player_name <chr>, player_name_i <chr>, x_legacy <int>,
#> #   y_legacy <int>, shot_distance <int>, shot_result <chr>,
#> #   is_field_goal <int>, score_home <chr>, score_away <chr>,
#> #   points_total <int>, location <chr>, description <chr>, action_type <chr>,
#> #   sub_type <chr>, video_available <int>, shot_value <int>, action_id <int>,
#> #   game_id <chr>, seconds_remaining <dbl>, event_type <chr>, …
# }