Skip to contents

Loads shot events scraped from the WNBA Stats API. One row per shot attempt with legacy court coordinates, action/sub type, distance, and made/missed result, carried through from the V3 play-by-play feed (not shotchartdetail). Backed by the wehoop-wnba-stats-data pipeline that reads raw JSONs from wehoop-wnba-stats-raw and publishes parquet/rds artifacts to the wnba_stats_shots release tag.

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

Usage

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

load_wnba_stats_shots_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 shots data table within the database

Value

Returns a wehoop_data tibble with one row per shot attempt.

col_nametypesdescription
game_idcharacterUnique game identifier.
seasonintegerSeason identifier (4-digit year).
periodintegerPeriod of the game (1-4 quarters; 5+ for OT).
clockcharacterGame clock remaining in the period (ISO 8601 duration).
team_idintegerUnique team identifier for the shooting team.
team_tricodecharacterThree-letter team code (e.g. 'LAS' / 'NYL').
person_idintegerUnique player identifier for the shooter.
player_namecharacterShooter's name.
action_typecharacterAction type label ('Made Shot' or 'Missed Shot').
sub_typecharacterShot sub type (e.g. 'Jump Shot', 'Layup', 'DUNK').
shot_resultcharacterShot result, 'Made' or 'Missed'.
shot_valueintegerPoints the shot was worth (2 or 3).
shot_distanceintegerShot distance from the basket, in feet.
x_legacyintegerLegacy X coordinate on the court (0 = basket center).
y_legacyintegerLegacy Y coordinate on the court (baseline at 0).
descriptioncharacterText description of the play.
score_homecharacterHome team score after the play.
score_awaycharacterAway team score after the play.

Examples

# \donttest{
  try(load_wnba_stats_shots(seasons = most_recent_wnba_stats_season()))
#> ──────────────────────────────────────────────────────────────── wehoop 3.0.0 ──
#> # A tibble: 27,606 × 18
#>    game_id    season period clock     team_id team_tricode person_id player_name
#>    <chr>       <int>  <int> <chr>       <int> <chr>            <int> <chr>      
#>  1 1022600001   2026      1 PT09M44.…  1.61e9 CON            1642800 Morrow     
#>  2 1022600001   2026      1 PT09M25.…  1.61e9 NYL            1627668 Stewart    
#>  3 1022600001   2026      1 PT09M17.…  1.61e9 CON            1641649 Miller     
#>  4 1022600001   2026      1 PT08M34.…  1.61e9 NYL            1629546 Johannes   
#>  5 1022600001   2026      1 PT08M21.…  1.61e9 CON             203398 Griner     
#>  6 1022600001   2026      1 PT08M15.…  1.61e9 NYL            1631136 Astier     
#>  7 1022600001   2026      1 PT07M56.…  1.61e9 NYL            1631136 Astier     
#>  8 1022600001   2026      1 PT07M36.…  1.61e9 CON             203398 Griner     
#>  9 1022600001   2026      1 PT07M20.…  1.61e9 NYL            1629546 Johannes   
#> 10 1022600001   2026      1 PT07M06.…  1.61e9 NYL             204335 Laney-Hami…
#> # ℹ 27,596 more rows
#> # ℹ 10 more variables: action_type <chr>, sub_type <chr>, shot_result <chr>,
#> #   shot_value <int>, shot_distance <int>, x_legacy <int>, y_legacy <int>,
#> #   description <chr>, score_home <chr>, score_away <chr>
# }