Learn R Programming

wehoop (version 3.0.0)

load_wnba_stats_rosters: Load cleaned WNBA Stats API season rosters from the data repo

Description

Loads season-level WNBA team rosters scraped from the WNBA Stats API. One row per athlete-team-season triple. 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_rosters release tag.

Loads season-level WNBA coaching staff data scraped from the WNBA Stats API. One row per coach-team-season triple. 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_coaches release tag.

[Deprecated] Loads season-level WNBA player statistics. Deprecated: the wnba_stats_player_season_stats release tag (R-scraped, Base/Advanced/Misc/Scoring/Usage/ Defense measures) is superseded by the wnba_stats_leaguedash tag (Python-scraped parameter cube, same 6 measure types plus player_bio and a wide player_master mega). This function reshapes the cube back into the old stacked-by-measure_type contract for compatibility; call the cube's player_stats_* / player_master assets directly with load_wnba_stats_leaguedash() for the full surface.

[Deprecated] Loads season-level WNBA 5-man lineup statistics (leaguedashlineups-style outputs). Deprecated: the wnba_stats_lineups release tag (R-scraped, Base/Advanced measures, 5-man only) is superseded by the wnba_stats_leaguedash tag (Python-scraped parameter cube: 6 measure types x 2/3/4/5-man). This function reshapes the cube back into the old 5-man Base+Advanced contract for compatibility; call the cube's lineups_* / lineups_master assets directly with load_wnba_stats_leaguedash() for the full surface.

[Deprecated] Loads season-level team statistics (leaguedashteamstats-style outputs). Deprecated: the wnba_stats_team_season_stats release tag (R-scraped, Base/ Advanced/Misc/Scoring/Defense/Opponent measures) is superseded by the wnba_stats_leaguedash tag (Python-scraped parameter cube, same 6 measures plus Four Factors and a wide team_master mega). This function reshapes the cube back into the old stacked-by-measure_type contract for compatibility; call the cube's team_stats_* / team_master assets directly with load_wnba_stats_leaguedash() for the full surface.

[Deprecated] Loads season-level WNBA standings (leaguestandingsv3-style outputs). One row per team-season. Deprecated: the wnba_stats_standings release tag (R-scraped) is superseded by the wnba_stats_leaguedash tag's standings asset (same underlying endpoint/params, Python-scraped) — this is close to a pure passthrough.

Loads season-level WNBA draft picks scraped from the WNBA Stats API (drafthistory-style outputs). One row per pick. 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_draft release tag.

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.

Loads the per-game inactive player list scraped from the WNBA Stats API -- the InactivePlayers result set of boxscoresummaryv2. One row per inactive athlete-game pair, not a full per-game roster: use load_wnba_stats_player_game_logs() for the athletes who did play. 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_game_rosters release tag.

Coverage is thin by construction because the upstream result set is thin: stats.wnba.com reports inactives for only a fraction of games, and most heavily for 2006-2008 and 2021 onward. Season row counts range from 1 (1997) to 610 across 184 games (2026); 2009-2012 carry fewer than 10 rows each. A season with almost no rows is upstream sparsity, not a download failure.

Loads game-level officials data scraped from the WNBA Stats API (boxscoresummaryv2-style outputs). One row per official-game pair. 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_officials release tag.

Loads per-player per-game logs scraped from stats.wnba.com/leaguegamelog?PlayerOrTeam=P (one row per athlete-game pair: minutes, shooting splits, rebounds, steals, blocks, turnovers, personal fouls, plus/minus). Backed by the wehoop-wnba-stats-data pipeline that publishes parquet/rds artifacts to the wnba_stats_player_game_logs release tag.

Loads season-level WNBA schedules scraped from stats.wnba.com/leaguegamefinder (regular season + playoffs combined, pre-rejoined home/away). Backed by the wehoop-wnba-stats-data pipeline that publishes parquet/rds artifacts to the wnba_stats_schedules release tag.

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_rosters_manifest() returns the per-season manifest CSV (season, row_count, generated_at_utc, source_endpoint) for the WNBA Stats rosters release tag without downloading any season's full data.

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

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

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

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

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

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

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.

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

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

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

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

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.

Loads possession-level data derived from the WNBA Stats API play-by-play -- one row per possession, with the on-court 5-man lineups for both teams, shooting/rebounding/turnover splits, and the possession start type. Backed by the wehoop-wnba-stats-data pipeline that reads raw JSONs from wehoop-wnba-stats-raw and publishes csv.gz/parquet/rds artifacts to the wnba_stats_possessions release tag.

Usage

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

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

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

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

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

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

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

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

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

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

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

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

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

load_wnba_stats_rosters_manifest()

load_wnba_stats_coaches_manifest()

load_wnba_stats_player_stats_manifest()

load_wnba_stats_lineups_manifest()

load_wnba_stats_team_stats_manifest()

load_wnba_stats_standings_manifest()

load_wnba_stats_draft_manifest()

load_wnba_stats_shots_manifest()

load_wnba_stats_game_rosters_manifest()

load_wnba_stats_officials_manifest()

load_wnba_stats_player_game_logs_manifest()

load_wnba_stats_schedule_manifest()

load_wnba_stats_pbp_manifest()

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

Value

Returns a wehoop_data tibble with one row per athlete-team-season.

Returns a wehoop_data tibble with one row per coach-team-season.

Returns a wehoop_data tibble of player season stats.

Returns a wehoop_data tibble of lineup stats.

Returns a wehoop_data tibble of team season stats.

col_nametypesdescription
seasonintegerSeason identifier (4-digit year or 'YYYY-YY' string).
season_typecharacterSeason type (1=pre-season, 2=regular season, 3=postseason, 4=off-season for ESPN; or string label for WNBA Stats).
team_idcharacterUnique team identifier.
team_namecharacterFull team display name (e.g. 'Las Vegas Aces').
team_abbreviationcharacterShort team abbreviation (e.g. 'LAS').
gpintegerGames played.
wintegerWins.
lintegerLosses.
w_pctnumericWins percentage (0-1 decimal).
minnumericMinutes played.
fgmnumericField goals made.
fganumericField goal attempts.
fg_pctnumericField goal percentage (0-1).
fg3mnumericThree-point field goals made.
fg3anumericThree-point field goal attempts.
fg3_pctnumericThree-point field goal percentage (0-1).
ftmnumericFree throws made.
ftanumericFree throw attempts.
ft_pctnumericFree throw percentage (0-1).
orebnumericOffensive rebounds.
drebnumericDefensive rebounds.
rebnumericTotal rebounds.
astnumericAssists.
tovnumericTurnovers.
stlnumericSteals.
blknumericBlocks.
pfnumericPersonal fouls.
ptsnumericPoints scored.
plus_minusnumericPlus/minus point differential while on court.

Returns a wehoop_data tibble of team standings.

col_nametypesdescription
seasonintegerSeason identifier (4-digit year or 'YYYY-YY' string).
season_idcharacterUnique season identifier.
team_idcharacterUnique team identifier.
team_citycharacterTeam city or region (e.g. 'Las Vegas').
team_namecharacterFull team display name (e.g. 'Las Vegas Aces').
conferencecharacterFilter players or teams by conference.
conference_recordcharacterConference win-loss record.
playoff_rankintegerLeague/season rank for playoff.
winsintegerTotal wins.
lossesintegerTotal losses.
win_pctnumericWin percentage (0-1 decimal).
home_recordcharacterHome win-loss record.
road_recordcharacterWin-loss record for road.
l10characterL10.
strcurrentstreakcharacterStrcurrentstreak.
points_pgnumericPoints pg.
opp_points_pgnumericOpponent points pg.
diff_points_pgnumericDiff points pg.

Returns a wehoop_data tibble of WNBA draft picks.

col_nametypesdescription
person_idintegerUnique player identifier (V3 endpoints).
player_namecharacterPlayer name.
seasonintegerSeason identifier (4-digit year).
round_numberintegerNumeric round.
round_pickintegerRound pick.
overall_pickintegerOverall pick.
draft_typecharacterDraft type ('Draft', 'Allocation' or 'Elite').
team_idintegerUnique team identifier.
team_citycharacterTeam city or region (e.g. 'Las Vegas').
team_namecharacterFull team display name (e.g. 'Las Vegas Aces').
team_abbreviationcharacterShort team abbreviation (e.g. 'LAS').
organizationcharacterOrganization.
organization_typecharacterOrganization type.
player_profile_flagintegerPlayer profile flag.

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.

Returns a wehoop_data tibble with one row per inactive athlete-game pair.

col_nametypesdescription
player_idintegerUnique player identifier.
first_namecharacterPlayer's first name.
last_namecharacterPlayer's last name.
jersey_numcharacterJersey number worn by the player.
team_idintegerUnique team identifier.
team_citycharacterTeam city or region (e.g. 'Las Vegas').
team_namecharacterFull team display name (e.g. 'Las Vegas Aces').
team_abbreviationcharacterShort team abbreviation (e.g. 'LAS').
seasonintegerSeason identifier (4-digit year).
game_idcharacterUnique game identifier.

Returns a wehoop_data tibble with one row per official-game pair.

col_nametypesdescription
official_idintegerUnique official / referee identifier.
first_namecharacterOfficial's first name.
last_namecharacterOfficial's last name.
jersey_numcharacterJersey number worn by the official.
seasonintegerSeason identifier (4-digit year).
game_idcharacterUnique game identifier.

Returns a wehoop_data tibble of per-athlete per-game log rows.

Returns a wehoop_data tibble of per-season schedules, one row per game with the home/away sides pre-joined into home_* / away_* columns.

col_nametypesdescription
game_idcharacterUnique game identifier.
seasonintegerSeason identifier (4-digit year).
season_typecharacterPortion of the season: regular-season or playoffs.
game_datecharacterDate the game was played, as an ISO YYYY-MM-DD string.
matchupcharacterMatchup string, home side first (e.g. WAS vs. NYL).
home_team_idintegerUnique WNBA Stats team identifier for the home team.
home_team_abbreviationcharacterHome team abbreviation.
home_team_namecharacterHome team full name.
home_ptsintegerPoints scored by the home team.
home_wlcharacterHome team result, W or L.
away_team_idintegerUnique WNBA Stats team identifier for the away team.
away_team_abbreviationcharacterAway team abbreviation.
away_team_namecharacterAway team full name.
away_ptsintegerPoints scored by the away team.
away_wlcharacterAway team result, W or L.

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

Returns a wehoop_data tibble with one row per possession.

col_nametypesdescription
game_idcharacterUnique game identifier.
periodintegerPeriod of the game (1-2 halves pre-2016, 1-4 quarters 2016+).
possession_numberintegerSequential possession number within the game.
offense_team_idintegerTeam identifier for the team on offense.
defense_team_idintegerTeam identifier for the team on defense.
start_order_indexintegerPlay-by-play order index at the start of the possession.
end_order_indexintegerPlay-by-play order index at the end of the possession.
start_seconds_remainingnumericSeconds remaining in the period at possession start.
end_seconds_remainingnumericSeconds remaining in the period at possession end.
pointsintegerPoints scored on the possession.
is_second_chancelogicalWhether the possession followed an offensive rebound.
number_in_periodintegerSequential possession number within the period.
possession_start_typecharacterHow the possession started (e.g. 'OffDeadball', 'OffRebound').
count_as_possessionlogicalWhether the event counts as a scoreable possession.
fg2ainteger2-point field goal attempts by the lineup.
fg2minteger2-point field goals made by the lineup.
fg3aintegerFg3a.
fg3mintegerFg3m.
ftaintegerFree throw attempts by the lineup.
ftmintegerFree throws made by the lineup.
orebintegerOffensive rebounds.
drebintegerDefensive rebounds.
tovintegerTurnovers.
off_player_1integerOffensive lineup slot 1 player identifier.
off_player_2integerOffensive lineup slot 2 player identifier.
off_player_3integerOffensive lineup slot 3 player identifier.
off_player_4integerOffensive lineup slot 4 player identifier.
off_player_5integerOffensive lineup slot 5 player identifier.
def_player_1integerDefensive lineup slot 1 player identifier.
def_player_2integerDefensive lineup slot 2 player identifier.
def_player_3integerDefensive lineup slot 3 player identifier.
def_player_4integerDefensive lineup slot 4 player identifier.
def_player_5integerDefensive lineup slot 5 player identifier.
seasonintegerSeason identifier (4-digit year).

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

Author

Saiem Gilani

See Also

Other WNBA Stats loader functions: load_wnba_stats_leaguedash()

Examples

Run this code
# \donttest{
  try(load_wnba_stats_rosters(seasons = most_recent_wnba_stats_season()))
# }
# \donttest{
  try(load_wnba_stats_coaches(seasons = most_recent_wnba_stats_season()))
# }
# \donttest{
  try(load_wnba_stats_player_stats(seasons = most_recent_wnba_stats_season()))
# }
# \donttest{
  try(load_wnba_stats_lineups(seasons = most_recent_wnba_stats_season()))
# }
# \donttest{
  try(load_wnba_stats_team_stats(seasons = most_recent_wnba_stats_season()))
# }
# \donttest{
  try(load_wnba_stats_standings(seasons = most_recent_wnba_stats_season()))
# }
# \donttest{
  try(load_wnba_stats_draft(seasons = most_recent_wnba_stats_season()))
# }
# \donttest{
  try(load_wnba_stats_shots(seasons = most_recent_wnba_stats_season()))
# }
# \donttest{
  try(load_wnba_stats_game_rosters(seasons = most_recent_wnba_stats_season()))
# }
# \donttest{
  try(load_wnba_stats_officials(seasons = most_recent_wnba_stats_season()))
# }
# \donttest{
  try(load_wnba_stats_player_game_logs(seasons = most_recent_wnba_stats_season()))
# }
# \donttest{
  try(load_wnba_stats_schedule(seasons = most_recent_wnba_stats_season()))
# }
# \donttest{
  try(load_wnba_stats_pbp(seasons = most_recent_wnba_stats_season()))
# }
# \donttest{
  try(load_wnba_stats_possessions(seasons = most_recent_wnba_stats_season()))
# }

Run the code above in your browser using DataLab