Skip to contents

helper that loads multiple seasons from the data repo either into memory or writes it into a db using some forwarded arguments in the dots

Usage

load_mbb_team_box(
  seasons = most_recent_mbb_season(),
  ...,
  dbConnection = NULL,
  tablename = NULL
)

Arguments

seasons

A vector of 4-digit years associated with given men's college basketball seasons. (Min: 2003)

...

Additional arguments passed to an underlying function that writes the season data into a database (used by update_mbb_db()).

dbConnection

A DBIConnection object, as returned by

tablename

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

Value

Returns a tibble

col_nametypesdescription
team_idcharacterUnique team identifier.
team_uidcharacterESPN universal team identifier (UID format 's:40~l:...~t:...').
team_slugcharacterURL-safe team identifier (e.g. 'lasvegas-aces' / 'aces').
team_locationcharacterTeam city or location string.
team_namecharacterFull team display name (e.g. 'Las Vegas Aces').
team_abbreviationcharacterShort team abbreviation (e.g. 'LAS').
team_display_namecharacterFull team display name.
team_short_display_namecharacterShort team display name (e.g. 'Aces').
team_colorcharacterTeam primary color (hex without leading '#').
team_alternate_colorcharacterTeam alternate color (hex without leading '#').
team_logocharacterTeam logo image URL.
field_goals_made_field_goals_attemptedcharacterField Goals Made-Attempted.
field_goal_pctcharacterField goal percentage (0-1).
three_point_field_goals_made_three_point_field_goals_attemptedcharacter3-Point Field Goals Made-Attempted.
three_point_field_goal_pctcharacterThree-point field goal percentage (0-1).
free_throws_made_free_throws_attemptedcharacterFree Throws Made-Attempted.
free_throw_pctcharacterFree throw percentage (0-1).
total_reboundscharacterTotal rebounds.
offensive_reboundscharacterOffensive rebounds.
defensive_reboundscharacterDefensive rebounds.
assistscharacterTotal assists.
stealscharacterTotal steals.
blockscharacterTotal blocks.
turnoverscharacterTotal turnovers.
team_turnoverscharacterTeam turnovers (turnovers credited to the team rather than a player).
total_turnoverscharacterTotal turnovers (player + team).
technical_foulscharacterTotal technical fouls.
total_technical_foulscharacterTotal technical fouls (player + team).
flagrant_foulscharacterTotal flagrant fouls.
foulscharacterPersonal fouls.
largest_leadcharacterLargest lead during the game.
home_awaycharacterGame venue label ('home' or 'away').
opponent_idintegerUnique identifier for opponent.
opponent_namecharacterOpponent name.
opponent_mascotcharacterOpponent mascot.
opponent_abbrevcharacterAbbreviation for opponent.
game_idintegerUnique game identifier.
seasonintegerSeason identifier (4-digit year or 'YYYY-YY' string).
season_typeintegerSeason type (1=pre-season, 2=regular season, 3=postseason, 4=off-season for ESPN; or string label for WNBA Stats).
game_dateDateGame date (YYYY-MM-DD).

Examples

# \donttest{
load_mbb_team_box(seasons = most_recent_mbb_season())
#> ── ESPN MBB Team Boxscores from hoopR data repository ─────────── hoopR 3.1.0 ──
#>  Data updated: 2026-04-30 11:41:44 UTC
#> # A tibble: 12,598 × 59
#>      game_id season season_type game_date  game_date_time      team_id team_uid 
#>        <int>  <int>       <int> <date>     <dttm>                <int> <chr>    
#>  1 401856600   2026           3 2026-04-06 2026-04-06 20:50:00      41 s:40~l:4…
#>  2 401856600   2026           3 2026-04-06 2026-04-06 20:50:00     130 s:40~l:4…
#>  3 401858363   2026           3 2026-04-05 2026-04-05 20:00:00     202 s:40~l:4…
#>  4 401858363   2026           3 2026-04-05 2026-04-05 20:00:00       2 s:40~l:4…
#>  5 401858385   2026           3 2026-04-05 2026-04-05 17:30:00     201 s:40~l:4…
#>  6 401858385   2026           3 2026-04-05 2026-04-05 17:30:00     277 s:40~l:4…
#>  7 401856599   2026           3 2026-04-04 2026-04-04 21:19:00     130 s:40~l:4…
#>  8 401856599   2026           3 2026-04-04 2026-04-04 21:19:00      12 s:40~l:4…
#>  9 401856598   2026           3 2026-04-04 2026-04-04 18:09:00     356 s:40~l:4…
#> 10 401856598   2026           3 2026-04-04 2026-04-04 18:09:00      41 s:40~l:4…
#> # ℹ 12,588 more rows
#> # ℹ 52 more variables: team_slug <chr>, team_location <chr>, team_name <chr>,
#> #   team_abbreviation <chr>, team_display_name <chr>,
#> #   team_short_display_name <chr>, team_color <chr>,
#> #   team_alternate_color <chr>, team_logo <chr>, team_home_away <chr>,
#> #   team_score <int>, team_winner <lgl>, assists <int>, blocks <int>,
#> #   defensive_rebounds <int>, fast_break_points <chr>, field_goal_pct <dbl>, …
# }