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

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

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

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

helper that loads multiple seasons of ESPN men's college basketball team rosters from the sportsdataverse-data release repo, either into memory or into a database via forwarded arguments in the dots.

helper that loads multiple seasons of ESPN men's college basketball player season stats (long format) from the sportsdataverse-data release repo, either into memory or into a database via forwarded arguments in the dots.

helper that loads multiple seasons of ESPN men's college basketball team season stats (long format) from the sportsdataverse-data release repo, either into memory or into a database via forwarded arguments in the dots.

helper that loads multiple seasons of ESPN men's college basketball standings from the sportsdataverse-data release repo, either into memory or into a database via forwarded arguments in the dots.

helper that loads multiple seasons of ESPN men's college basketball per-game rosters from the sportsdataverse-data release repo, either into memory or into a database via forwarded arguments in the dots.

helper that loads multiple seasons of ESPN men's college basketball per-game officials from the sportsdataverse-data release repo, either into memory or into a database via forwarded arguments in the dots.

helper that loads multiple seasons of ESPN MBB athlete core records – identity and biographical fields, one row per athlete who appeared in the season – from the sportsdataverse-data release repo, either into memory or into a database via forwarded arguments in the dots.

This is the only source of athlete bio in the pipeline: the player season stats payload carries no identity at all – not even the athlete id.

Two properties of the source are worth knowing before joining:

  • current_team_id is the athlete's CURRENT team, not their team in the requested season. Season team lives in load_mbb_player_box() / load_mbb_player_stats().

  • Bio (height / weight / jersey) is a current snapshot that ESPN overwrites in place; it is not era-correct for a historical season. The season dimension here is participation, not the bio's vintage.

Field coverage is era-dependent by nature – headshots exist only for modern players, while college and date of birth thin out the other way.

Loads shot events parsed from ESPN men's college basketball play-by-play feeds. One row per shot attempt (made or missed), with court coordinates and shot metadata. Backed by the hoopR-mbb-data pipeline, publishing parquet/rds artifacts to the espn_mens_college_basketball_shots release tag. Published coverage runs 2003 and 2006 through the most recent season – 2004 and 2005 are a documented gap (no shot-coordinate assets were published for those two seasons).

Usage

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

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

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

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

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

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

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

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

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

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

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

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

Source

The espn_mens_college_basketball_pbp release: https://github.com/sportsdataverse/sportsdataverse-data/releases/tag/espn_mens_college_basketball_pbp, published by https://github.com/sportsdataverse/hoopR-mbb-data.

The espn_mens_college_basketball_team_boxscores release: https://github.com/sportsdataverse/sportsdataverse-data/releases/tag/espn_mens_college_basketball_team_boxscores, published by https://github.com/sportsdataverse/hoopR-mbb-data.

The espn_mens_college_basketball_player_boxscores release: https://github.com/sportsdataverse/sportsdataverse-data/releases/tag/espn_mens_college_basketball_player_boxscores, published by https://github.com/sportsdataverse/hoopR-mbb-data.

The espn_mens_college_basketball_schedules release: https://github.com/sportsdataverse/sportsdataverse-data/releases/tag/espn_mens_college_basketball_schedules, published by https://github.com/sportsdataverse/hoopR-mbb-data.

The espn_mens_college_basketball_rosters release: https://github.com/sportsdataverse/sportsdataverse-data/releases/tag/espn_mens_college_basketball_rosters, published by https://github.com/sportsdataverse/hoopR-mbb-data.

The espn_mens_college_basketball_player_season_stats release: https://github.com/sportsdataverse/sportsdataverse-data/releases/tag/espn_mens_college_basketball_player_season_stats, published by https://github.com/sportsdataverse/hoopR-mbb-data.

The espn_mens_college_basketball_team_season_stats release: https://github.com/sportsdataverse/sportsdataverse-data/releases/tag/espn_mens_college_basketball_team_season_stats, published by https://github.com/sportsdataverse/hoopR-mbb-data.

The espn_mens_college_basketball_standings release: https://github.com/sportsdataverse/sportsdataverse-data/releases/tag/espn_mens_college_basketball_standings, published by https://github.com/sportsdataverse/hoopR-mbb-data.

The espn_mens_college_basketball_game_rosters release: https://github.com/sportsdataverse/sportsdataverse-data/releases/tag/espn_mens_college_basketball_game_rosters, published by https://github.com/sportsdataverse/hoopR-mbb-data.

The espn_mens_college_basketball_officials release: https://github.com/sportsdataverse/sportsdataverse-data/releases/tag/espn_mens_college_basketball_officials, published by https://github.com/sportsdataverse/hoopR-mbb-data.

The espn_mens_college_basketball_player_core release: https://github.com/sportsdataverse/sportsdataverse-data/releases/tag/espn_mens_college_basketball_player_core, published by https://github.com/sportsdataverse/hoopR-mbb-data.

The espn_mens_college_basketball_shots release: https://github.com/sportsdataverse/sportsdataverse-data/releases/tag/espn_mens_college_basketball_shots, published by https://github.com/sportsdataverse/hoopR-mbb-data.

Arguments

seasons

A vector of 4-digit years associated with given men's college basketball seasons, or TRUE for every published season. Each loader accepts only the seasons its release tag publishes (any other season is an error):

  • load_mbb_pbp(), load_mbb_shots(): 2003 and 2006 onward (2004-2005 were never published).

  • load_mbb_team_box(), load_mbb_player_box(), load_mbb_team_stats(), load_mbb_standings(), load_mbb_player_core(): 2003 onward.

  • load_mbb_schedule(): 2002 onward.

  • load_mbb_game_rosters(): 2002 onward.

  • load_mbb_officials(): 2003 onward, except 2010.

  • load_mbb_player_stats(): 2003 onward (ESPN's single-season player rows are sparse before about 2010).

  • load_mbb_rosters(): 2025 onward.

Every season in those ranges is published as .rds (checked 2026-11-13). The upper bound is most_recent_mbb_season(). When seasons is left at its default and that season's file is not published yet, the loader reads the newest published season instead, with a message. An explicit request for that not-yet-published season is kept as asked: the read warns and returns an empty frame. A season outside the published range, or in a known gap, is an error.

...

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

A hoopR_data tibble with one row per play-by-play event.

col_nametypesdescription
game_play_numberintegerSequential play number within the game.
idcharacterESPN play id, exact (see Details).
play_idcharacterESPN play id, the same value as id. The game story and win probability frames carry the play under this name.
sequence_numberintegerSequence number representing a shot-possession (V3 PBP).
type_idintegerType identifier (numeric).
type_textcharacterDisplay text for the type field.
textcharacterText description of the play / record.
away_scoreintegerAway team score after the play. Rebuilt from the scoring plays in feed order when that reaches the official final (score_source 'rebuilt'), otherwise ESPN's per-play value (score_source 'espn').
home_scoreintegerHome team score after the play. Rebuilt from the scoring plays in feed order when that reaches the official final (score_source 'rebuilt'), otherwise ESPN's per-play value (score_source 'espn').
period_numberintegerNumeric period (1-4 for quarters; 5+ for OT).
period_display_valuecharacterPeriod display label (e.g. '1st Quarter', 'OT').
clock_display_valuecharacterGame clock display string (e.g. '8:32').
scoring_playlogicalTRUE if the play resulted in points scored.
score_valueintegerPoint value of the play (2 / 3 / 1).
wallclockcharacterWallclock.
shooting_playlogicalTRUE if the play was a shooting attempt.
coordinate_x_rawnumericX coordinate as returned by the API before any adjustment.
coordinate_y_rawnumericY coordinate as returned by the API before any adjustment.
points_attemptedintegerPoint value at stake on the shot attempt (3 for threes, 2 for other field goals, 1 for free throws), from the ESPN play type.
short_descriptioncharacterShortened version of ESPN's play description text, without score context.
team_idintegerUnique team identifier.
athlete_id_1integerPrimary athlete identifier (e.g. shooter).
athlete_id_2integerSecondary athlete identifier (e.g. assister / fouler).
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).
home_team_idintegerUnique identifier for the home team.
home_team_namecharacterHome team name.
home_team_mascotcharacterHome team mascot.
home_team_abbrevcharacterHome team three-letter abbreviation.
home_team_name_altcharacterAlternate home team name.
away_team_idintegerUnique identifier for the away team.
away_team_namecharacterAway team name.
away_team_mascotcharacterAway team mascot.
away_team_abbrevcharacterAway team three-letter abbreviation.
away_team_name_altcharacterAlternate away team name.
game_spreadnumericGame spread (signed; positive = home favored).
home_favoritelogicalTRUE if the home team is the betting favorite.
game_spread_availablelogicalTRUE if a point spread was available.
home_team_spreadnumericHome team's point spread.
halfintegerHalf of the game: 1 or 2 in regulation; overtime periods continue the count (3, 4, ...).
timecharacterTime / clock value.
clock_minutesintegerClock minutes split out for convenience.
clock_secondsintegerClock seconds split out for convenience.
home_timeout_calledlogicalTRUE when the home team called a timeout on the play.
away_timeout_calledlogicalTRUE when the away team called a timeout on the play.
lag_periodintegerPeriod number of the previous play in the same game (period_number shifted forward one row within game_id), and NA on each game's first play.
lead_periodintegerPeriod number of the next play in the same game (period_number shifted back one row within game_id), and NA on each game's final play.
lag_halfintegerHalf of the previous play in the same game, NA on each game's first play.
lead_halfintegerHalf of the next play in the same game, NA on each game's final play.
start_period_seconds_remainingintegerSeconds left in the current period when the play started, computed as 60 times the game clock minutes plus the seconds, so 1200 at the tip of each 20-minute half and 300 at the start of an overtime.
start_game_seconds_remainingintegerSeconds remaining in the game at the start of the play.
end_period_seconds_remainingintegerSeconds left in the period when the play ended.
end_game_seconds_remainingintegerSeconds remaining in the game at the end of the play.
coordinate_xnumericX coordinate on the court (half-court layout).
coordinate_ynumericY coordinate on the court (half-court layout).
game_dateDateGame date (YYYY-MM-DD).
game_date_timePOSIXctGame start date/time (ISO 8601).
score_sourcecharacterWhere this game's home_score/away_score come from: 'rebuilt' (summed from the scoring plays and equal to the official final on the last play) or 'espn' (ESPN's per-play values, kept when the rebuild misses the final or the game has no final). Absent from seasons published before the repair.
athlete_name_1characterDisplay name of the primary athlete (e.g. the shooter).
athlete_name_2characterDisplay name of the secondary athlete, when present.
athlete_name_3characterDisplay name of the third athlete in the ESPN play participants, when present.
pregame_home_probnumericModel's pre-game win probability for the home team (0-1), constant within a game. Present only on the seasons published with the win-probability model; absent on the others.
home_win_probnumericModel's in-game win probability for the home team (0-1) after the play.

A hoopR_data tibble with one row per team-game.

col_nametypesdescription
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).
game_date_timePOSIXctGame start date/time (ISO 8601).
team_idintegerUnique 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.
team_home_awaycharacterWhether the team is the home or the away side ('home' or 'away').
team_scoreintegerTeam's score / final score.
team_winnerlogicalTRUE if the team won this game.
assistsintegerTotal assists.
blocksintegerTotal blocks.
defensive_reboundsintegerDefensive rebounds.
fast_break_pointscharacterFast-break points scored.
field_goal_pctnumericField goal percentage (0-1).
field_goals_madeintegerField goals made (2-pt + 3-pt).
field_goals_attemptedintegerField goal attempts (2-pt + 3-pt).
flagrant_foulsintegerTotal flagrant fouls.
foulsintegerPersonal fouls.
free_throw_pctnumericFree throw percentage (0-1).
free_throws_madeintegerFree throws made.
free_throws_attemptedintegerFree throw attempts.
largest_leadcharacterLargest lead during the game.
offensive_reboundsintegerOffensive rebounds.
points_in_paintcharacterPoints scored in the paint.
stealsintegerTotal steals.
team_turnoversintegerTeam turnovers (turnovers credited to the team rather than a player).
technical_foulsintegerTotal technical fouls.
three_point_field_goal_pctnumericThree-point field goal percentage (0-1).
three_point_field_goals_madeintegerThree-point field goals made.
three_point_field_goals_attemptedintegerThree-point field goal attempts.
total_reboundsintegerTotal rebounds.
total_technical_foulsintegerTotal technical fouls (player + team).
total_turnoversintegerTotal turnovers (player + team).
turnover_pointscharacterTurnover points.
turnoversintegerTotal turnovers.
opponent_team_idintegerUnique identifier for the opponent team.
opponent_team_uidcharacterESPN universal identifier of the opponent team.
opponent_team_slugcharacterOpponent team slug.
opponent_team_locationcharacterOpponent team city / location.
opponent_team_namecharacterOpponent team display name.
opponent_team_abbreviationcharacterOpponent team abbreviation.
opponent_team_display_namecharacterOpponent team full display name.
opponent_team_short_display_namecharacterOpponent team short display name.
opponent_team_colorcharacterOpponent team primary color (hex).
opponent_team_alternate_colorcharacterOpponent team alternate color (hex).
opponent_team_logocharacterOpponent team logo URL.
opponent_team_scoreintegerOpponent team's score.
lead_changescharacterTimes the lead changed hands during the game, as ESPN's team box score reports it (the same on both team rows).
lead_percentagecharacterShare of game time the team held the lead, as reported in ESPN's team boxscore.

A hoopR_data tibble with one row per player-game.

col_nametypesdescription
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).
game_date_timePOSIXctGame start date/time (ISO 8601).
athlete_idintegerUnique athlete identifier (ESPN).
athlete_display_namecharacterAthlete display name (full).
team_idintegerUnique team identifier.
team_namecharacterFull team display name (e.g. 'Las Vegas Aces').
team_locationcharacterTeam city or location string.
team_short_display_namecharacterShort team display name (e.g. 'Aces').
minutesnumericMinutes played, formatted MM:SS (V3 PT-duration parsed) or decimal minutes (V2).
field_goals_madeintegerField goals made (2-pt + 3-pt).
field_goals_attemptedintegerField goal attempts (2-pt + 3-pt).
three_point_field_goals_madeintegerThree-point field goals made.
three_point_field_goals_attemptedintegerThree-point field goal attempts.
free_throws_madeintegerFree throws made.
free_throws_attemptedintegerFree throw attempts.
offensive_reboundsintegerOffensive rebounds.
defensive_reboundsintegerDefensive rebounds.
reboundsintegerTotal rebounds.
assistsintegerTotal assists.
stealsintegerTotal steals.
blocksintegerTotal blocks.
turnoversintegerTotal turnovers.
foulsintegerPersonal fouls.
pointsintegerPoints scored.
starterlogicalTRUE if the player was in the starting lineup; FALSE otherwise.
ejectedlogicalTRUE if the player was ejected from the game.
did_not_playlogicalTRUE if the player did not appear in the game.
athlete_jerseycharacterAthlete jersey number.
athlete_short_namecharacterAthlete short display name.
athlete_headshot_hrefcharacterAthlete headshot image URL.
athlete_position_namecharacterAthlete position ('Guard', 'Forward', 'Center').
athlete_position_abbreviationcharacterAthlete position abbreviation (G / F / C).
team_display_namecharacterFull team display name.
team_uidcharacterESPN universal team identifier (UID format 's:40~l:...~t:...').
team_slugcharacterURL-safe team identifier (e.g. 'lasvegas-aces' / 'aces').
team_logocharacterTeam logo image URL.
team_abbreviationcharacterShort team abbreviation (e.g. 'LAS').
team_colorcharacterTeam primary color (hex without leading '#').
team_alternate_colorcharacterTeam alternate color (hex without leading '#').
home_awaycharacterGame venue label ('home' or 'away').
team_winnerlogicalTRUE if the team won this game.
team_scoreintegerTeam's score / final score.
opponent_team_idintegerUnique identifier for the opponent team.
opponent_team_namecharacterOpponent team display name.
opponent_team_locationcharacterOpponent team city / location.
opponent_team_display_namecharacterOpponent team full display name.
opponent_team_abbreviationcharacterOpponent team abbreviation.
opponent_team_logocharacterOpponent team logo URL.
opponent_team_colorcharacterOpponent team primary color (hex).
opponent_team_alternate_colorcharacterOpponent team alternate color (hex).
opponent_team_scoreintegerOpponent team's score.
activelogicalTRUE if the row represents an active record (player / team / season).

A hoopR_data tibble with one row per game.

col_nametypesdescription
idintegerId.
uidcharacterESPN UID string (universal identifier).
datecharacterDate in YYYY-MM-DD format.
attendancenumericReported attendance.
time_validlogicalTime valid.
neutral_sitelogicalNeutral site.
conference_competitionlogicalConference competition.
play_by_play_availablelogicalWhether ESPN lists play-by-play for the game.
recentlogicalRecent.
start_datecharacterStart date (YYYY-MM-DD).
broadcastcharacterBroadcast networks ESPN lists for the game, as one string.
highlightscharacterESPN highlight clips for the game, serialized as a single string; NA when none was published.
notes_typecharacterNotes type.
notes_headlinecharacterNotes headline.
broadcast_marketcharacterMarket of the first listed broadcast: 'national', 'home' or 'away'.
broadcast_namecharacterNetwork name of the first listed broadcast (e.g. 'ESPN').
type_idintegerType identifier (numeric).
type_abbreviationcharacterType abbreviation.
venue_idintegerUnique venue identifier.
venue_full_namecharacterVenue full name.
venue_address_citycharacterVenue address city.
venue_address_statecharacterVenue address state / region.
venue_indoorlogicalTRUE if the venue is indoors.
status_clocknumericStatus clock.
status_display_clockcharacterStatus display clock.
status_periodnumericStatus period.
status_type_idintegerUnique identifier for status type.
status_type_namecharacterStatus type name.
status_type_statecharacterStatus type state.
status_type_completedlogicalStatus type completed.
status_type_descriptioncharacterStatus type description.
status_type_detailcharacterStatus type detail.
status_type_short_detailcharacterStatus type short detail.
format_regulation_periodsnumericFormat regulation periods.
home_idintegerUnique identifier for home.
home_uidcharacterHome team's uid.
home_locationcharacterHome team's location.
home_namecharacterHome name.
home_abbreviationcharacterHome team's abbreviation.
home_display_namecharacterHome display name.
home_short_display_namecharacterHome short display name.
home_colorcharacterColor code (hex) for home.
home_alternate_colorcharacterColor code (hex) for home alternate.
home_is_activelogicalHome team's is active.
home_venue_idintegerUnique identifier for home venue.
home_logocharacterHome team logo URL.
home_conference_idintegerUnique identifier for home conference.
home_scoreintegerHome team score at the time of the play.
home_winnerlogicalHome team's winner.
home_current_ranknumericPoll ranking ESPN listed for the home team at game time; unranked teams carry 99.
home_linescorescharacterPeriod-by-period scores for the home team as a delimited string from ESPN's schedule feed.
home_recordscharacterRecord strings (overall and split records) for the home team from ESPN's schedule feed.
away_idintegerUnique identifier for away.
away_uidcharacterAway team's uid.
away_locationcharacterAway team's location.
away_namecharacterAway name.
away_abbreviationcharacterAway team's abbreviation.
away_display_namecharacterAway display name.
away_short_display_namecharacterAway short display name.
away_colorcharacterColor code (hex) for away.
away_alternate_colorcharacterColor code (hex) for away alternate.
away_is_activelogicalAway team's is active.
away_venue_idintegerUnique identifier for away venue.
away_logocharacterAway team logo URL.
away_conference_idintegerUnique identifier for away conference.
away_scoreintegerAway team score at the time of the play.
away_winnerlogicalAway team's winner.
away_current_ranknumericPoll ranking ESPN listed for the away team at game time; unranked teams carry 99.
away_linescorescharacterPeriod-by-period scores for the away team as a delimited string from ESPN's schedule feed.
away_recordscharacterRecord strings (overall and split records) for the away team from ESPN's schedule feed.
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).
status_type_alt_detailcharacterStatus type alt detail.
tournament_idintegerUnique identifier for tournament.
groups_idintegerUnique identifier for groups.
groups_namecharacterGroups name.
groups_short_namecharacterGroups short name.
groups_is_conferencelogicalGroups is conference.
game_jsonlogicalWhether the data repository holds a processed game JSON for this game.
game_json_urlcharacterURL of the processed game JSON in the raw data repository.
game_date_timePOSIXctGame start date/time (ISO 8601).
game_dateDateGame date (YYYY-MM-DD).
PBPlogicalWhether the game's play-by-play is in the published play-by-play release.
team_boxlogicalTeam box.
player_boxlogicalPlayer box.

Returns a tibble of MBB team rosters.

Returns a tibble of MBB player season stats (long format).

Returns a tibble of MBB team season stats (long format).

Returns a tibble of MBB standings.

Returns a tibble of MBB per-game rosters.

Returns a tibble of MBB per-game officials.

Returns a tibble of MBB athlete core records (one row per athlete-season).

A hoopR_data tibble with one row per shot attempt.

col_nametypesdescription
game_idintegerUnique game identifier.
seasonintegerSeason identifier (4-digit year).
period_numberintegerNumeric period (1-2 halves).
clock_display_valuecharacterGame clock display string (e.g. '8:32').
team_idintegerUnique team identifier.
athlete_id_1integerPrimary athlete identifier (the shooter).
athlete_id_2integerSecondary athlete identifier (e.g. assister / fouler).
type_idintegerType identifier (numeric).
type_textcharacterDisplay text for the shot/play type.
scoring_playlogicalTRUE if the play resulted in points scored.
score_valueintegerPoint value of the shot (2 / 3 / 1).
coordinate_xnumericX coordinate on the court (half-court layout).
coordinate_ynumericY coordinate on the court (half-court layout).
coordinate_x_rawnumericX coordinate as returned by the API before any adjustment.
coordinate_y_rawnumericY coordinate as returned by the API before any adjustment.
athlete_name_1characterDisplay name of the primary athlete (the shooter).
athlete_name_2characterDisplay name of the secondary athlete, when present.
team_namecharacterFull team display name.
team_mascotcharacterTeam mascot / nickname.
team_abbrevcharacterShort team abbreviation.

Details

The play id is returned as character. ESPN's men's college play ids have 18 digits, more than a double can hold exactly, and the .rds release asset stores them as doubles (about 41% of the 2025 ids collide there). load_mbb_pbp() therefore reads the .parquet asset, which keeps the exact 64-bit ids, when the arrow package is installed, and warns when it has to fall back to the .rds. The release publishes only id; the loader adds play_id, the same value, after it, as in espn_mbb_pbp(). A database table written before play_id existed gets the column, filled from id, the next time a season is appended; a table that stores id as a number (hoopR 3.1.0 and earlier) warns and should be rebuilt.

ESPN join ids are integer in every loader, as they are in the box scores and schedules: load_mbb_game_rosters() casts game_id, and load_mbb_rosters() casts athlete_id, both of which the release publishes as character.

See also

Other hoopR Loader Functions: load_nba_depthcharts(), load_nba_pbp()

Examples

# \donttest{
# One season is a ~80 MB download.
load_mbb_pbp(seasons = most_recent_mbb_season())
#> ── ESPN MBB pbp from hoopR data repository ────────────────────── hoopR 3.2.0 ──
#> # A tibble: 791,284 × 64
#>    game_play_number id           play_id sequence_number type_id type_text text 
#>               <int> <chr>        <chr>             <int>   <int> <chr>     <chr>
#>  1                1 40190227512… 401902…       120473789     615 Jumpball  "Sta…
#>  2                2 40190227512… 401902…       120473793     615 Jumpball  "Jum…
#>  3                3 40190227512… 401902…       120473795     615 Jumpball  "Jum…
#>  4                4 40190227512… 401902…       120474005     558 JumpShot  "Sha…
#>  5                5 40190227512… 401902…       120474009     618 Block Sh… "Dra…
#>  6                6 40190227512… 401902…       120474012     587 Defensiv… "Edu…
#>  7                7 40190227512… 401902…       120474014     558 JumpShot  "Edu…
#>  8                8 40190227512… 401902…       120474195     587 Defensiv… "Jas…
#>  9                9 40190227512… 401902…       120474436     598 Lost Bal… "Coo…
#> 10               10 40190227512… 401902…       120474439     607 Steal     "Jal…
#> # ℹ 791,274 more rows
#> # ℹ 57 more variables: away_score <int>, home_score <int>, period_number <int>,
#> #   period_display_value <chr>, clock_display_value <chr>, scoring_play <lgl>,
#> #   score_value <int>, wallclock <chr>, shooting_play <lgl>,
#> #   coordinate_x_raw <dbl>, coordinate_y_raw <dbl>, points_attempted <int>,
#> #   short_description <chr>, team_id <int>, athlete_id_1 <int>,
#> #   athlete_id_2 <int>, game_id <int>, season <int>, season_type <int>, …
# }
# \donttest{
load_mbb_team_box(seasons = most_recent_mbb_season())
#> ── ESPN MBB team_box from hoopR data repository ───────────────── hoopR 3.2.0 ──
#> ℹ Data updated: 2026-11-30 11:14:17 UTC
#> # A tibble: 3,260 × 59
#>      game_id season season_type game_date  game_date_time      team_id team_uid 
#>        <int>  <int>       <int> <date>     <dttm>                <int> <chr>    
#>  1 401922232   2027           2 2026-11-29 2026-11-29 16:00:00    2511 s:40~l:4…
#>  2 401922232   2027           2 2026-11-29 2026-11-29 16:00:00     248 s:40~l:4…
#>  3 401911189   2027           2 2026-11-29 2026-11-29 13:00:00     235 s:40~l:4…
#>  4 401911189   2027           2 2026-11-29 2026-11-29 13:00:00    2168 s:40~l:4…
#>  5 401923306   2027           2 2026-11-29 2026-11-29 12:00:00     315 s:40~l:4…
#>  6 401923306   2027           2 2026-11-29 2026-11-29 12:00:00     311 s:40~l:4…
#>  7 401920776   2027           2 2026-11-29 2026-11-29 12:00:00    2771 s:40~l:4…
#>  8 401920776   2027           2 2026-11-29 2026-11-29 12:00:00    2142 s:40~l:4…
#>  9 401929036   2027           2 2026-11-29 2026-11-29 13:00:00  108838 s:40~l:4…
#> 10 401929036   2027           2 2026-11-29 2026-11-29 13:00:00    2441 s:40~l:4…
#> # ℹ 3,250 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>, …
# }
# \donttest{
# One season is a ~7 MB download.
load_mbb_player_box(seasons = most_recent_mbb_season())
#> ── ESPN MBB player_box from hoopR data repository ─────────────── hoopR 3.2.0 ──
#> ℹ Data updated: 2026-11-30 11:14:59 UTC
#> # A tibble: 51,237 × 55
#>      game_id season season_type game_date  game_date_time      athlete_id
#>        <int>  <int>       <int> <date>     <dttm>                   <int>
#>  1 401922232   2027           2 2026-11-29 2026-11-29 16:00:00    5459813
#>  2 401922232   2027           2 2026-11-29 2026-11-29 16:00:00    5176801
#>  3 401922232   2027           2 2026-11-29 2026-11-29 16:00:00    5459812
#>  4 401922232   2027           2 2026-11-29 2026-11-29 16:00:00    5196932
#>  5 401922232   2027           2 2026-11-29 2026-11-29 16:00:00    5176643
#>  6 401922232   2027           2 2026-11-29 2026-11-29 16:00:00    5459814
#>  7 401922232   2027           2 2026-11-29 2026-11-29 16:00:00    5459811
#>  8 401922232   2027           2 2026-11-29 2026-11-29 16:00:00    5314490
#>  9 401922232   2027           2 2026-11-29 2026-11-29 16:00:00    5112181
#> 10 401922232   2027           2 2026-11-29 2026-11-29 16:00:00    5314496
#> # ℹ 51,227 more rows
#> # ℹ 49 more variables: athlete_display_name <chr>, team_id <int>,
#> #   team_name <chr>, team_location <chr>, team_short_display_name <chr>,
#> #   minutes <dbl>, field_goals_made <int>, field_goals_attempted <int>,
#> #   three_point_field_goals_made <int>,
#> #   three_point_field_goals_attempted <int>, free_throws_made <int>,
#> #   free_throws_attempted <int>, offensive_rebounds <int>, …
# }
# \donttest{
load_mbb_schedule(seasons = most_recent_mbb_season())
#> ── ESPN MBB schedules from hoopR data repository ──────────────── hoopR 3.2.0 ──
#> ℹ Data updated: 2026-11-30 11:31:23 UTC
#> # A tibble: 6,076 × 88
#>         id uid   date  attendance time_valid neutral_site play_by_play_available
#>      <int> <chr> <chr>      <dbl> <lgl>      <lgl>        <lgl>                 
#>  1  4.02e8 s:40… 2027…          0 TRUE       FALSE        FALSE                 
#>  2  4.02e8 s:40… 2027…          0 TRUE       FALSE        FALSE                 
#>  3  4.02e8 s:40… 2027…          0 TRUE       FALSE        FALSE                 
#>  4  4.02e8 s:40… 2027…          0 TRUE       FALSE        FALSE                 
#>  5  4.02e8 s:40… 2027…          0 TRUE       FALSE        FALSE                 
#>  6  4.02e8 s:40… 2027…          0 TRUE       FALSE        FALSE                 
#>  7  4.02e8 s:40… 2027…          0 TRUE       FALSE        FALSE                 
#>  8  4.02e8 s:40… 2027…          0 TRUE       FALSE        FALSE                 
#>  9  4.02e8 s:40… 2027…          0 TRUE       FALSE        FALSE                 
#> 10  4.02e8 s:40… 2027…          0 TRUE       FALSE        FALSE                 
#> # ℹ 6,066 more rows
#> # ℹ 81 more variables: recent <lgl>, start_date <chr>, broadcast <chr>,
#> #   notes_type <chr>, notes_headline <chr>, broadcast_market <chr>,
#> #   broadcast_name <chr>, type_id <int>, type_abbreviation <chr>,
#> #   venue_id <int>, venue_full_name <chr>, venue_address_city <chr>,
#> #   venue_address_state <chr>, venue_indoor <lgl>, status_clock <dbl>,
#> #   status_display_clock <chr>, status_period <dbl>, status_type_id <int>, …
# }
# \donttest{
# One season is a ~14 MB download.
load_mbb_shots(seasons = most_recent_mbb_season())
#> ── ESPN MBB shots from hoopR data repository ──────────────────── hoopR 3.2.0 ──
#> ℹ Data updated: 2026-11-30 11:31:44 UTC
#> # A tibble: 261,706 × 20
#>      game_id season period_number clock_display_value team_id athlete_id_1
#>        <int>  <int>         <int> <chr>                 <int>        <int>
#>  1 401922232   2027             1 19:32                  2511      5459812
#>  2 401922232   2027             1 19:32                  2511      5459812
#>  3 401922232   2027             1 19:23                   248      5108093
#>  4 401922232   2027             1 19:13                  2511      5459813
#>  5 401922232   2027             1 18:52                   248      4873093
#>  6 401922232   2027             1 18:52                   248      4873093
#>  7 401922232   2027             1 18:40                  2511      5176643
#>  8 401922232   2027             1 18:13                   248      5177707
#>  9 401922232   2027             1 17:46                   248      5060700
#> 10 401922232   2027             1 17:41                   248      5060700
#> # ℹ 261,696 more rows
#> # ℹ 14 more variables: athlete_id_2 <int>, type_id <int>, type_text <chr>,
#> #   scoring_play <lgl>, score_value <int>, coordinate_x <dbl>,
#> #   coordinate_y <dbl>, coordinate_x_raw <dbl>, coordinate_y_raw <dbl>,
#> #   athlete_name_1 <chr>, athlete_name_2 <chr>, team_name <chr>,
#> #   team_mascot <chr>, team_abbrev <chr>
# }