Skip to contents

Loads season-level team statistics scraped from the WNBA Stats API (leaguedashteamstats-style outputs). 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_team_season_stats release tag.

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.

Usage

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

load_wnba_stats_team_stats_manifest()

Arguments

seasons

A vector of 4-digit years associated with given WNBA seasons. (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 team season stats table within the database

Value

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.

Examples

# \donttest{
  try(load_wnba_stats_team_stats(seasons = most_recent_wnba_stats_season()))
#> ──────────────────────────────────────────────────────────────── wehoop 3.0.0 ──
#> # A tibble: 90 × 177
#>    team_id    team_name   gp    w     l     w_pct min   fgm   fga   fg_pct fg3m 
#>    <chr>      <chr>       <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>  <chr>
#>  1 1611661330 Atlanta Dr… 12    8     4     0.667 40    29.8  68.7  0.434  8.8  
#>  2 1611661329 Chicago Sky 13    4     9     0.308 40.4  28.3  68    0.416  6.2  
#>  3 1611661323 Connecticu… 14    2     12    0.143 40.4  28.8  68.6  0.42   5.2  
#>  4 1611661321 Dallas Win… 12    8     4     0.667 40    32.8  71.7  0.458  8.3  
#>  5 1611661331 Golden Sta… 12    7     5     0.583 40    28.9  70.8  0.408  12.1 
#>  6 1611661325 Indiana Fe… 12    7     5     0.583 40.8  31.3  70.3  0.446  8.9  
#>  7 1611661319 Las Vegas … 12    9     3     0.75  40    34.1  70.3  0.485  8.6  
#>  8 1611661320 Los Angele… 12    6     6     0.5   40    31    66.8  0.464  8.5  
#>  9 1611661324 Minnesota … 12    10    2     0.833 40    35    69.7  0.502  7.7  
#> 10 1611661313 New York L… 13    9     4     0.692 40.4  29.4  64.2  0.457  9.9  
#> # ℹ 80 more rows
#> # ℹ 166 more variables: fg3a <chr>, fg3_pct <chr>, ftm <chr>, fta <chr>,
#> #   ft_pct <chr>, oreb <chr>, dreb <chr>, reb <chr>, ast <chr>, tov <chr>,
#> #   stl <chr>, blk <chr>, blka <chr>, pf <chr>, pfd <chr>, pts <chr>,
#> #   plus_minus <chr>, gp_rank <chr>, w_rank <chr>, l_rank <chr>,
#> #   w_pct_rank <chr>, min_rank <chr>, fgm_rank <chr>, fga_rank <chr>,
#> #   fg_pct_rank <chr>, fg3m_rank <chr>, fg3a_rank <chr>, fg3_pct_rank <chr>, …
# }