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_schedule(
  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: 2002)

...

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
idintegerId.
uidcharacterESPN UID string (universal identifier).
datecharacterDate in YYYY-MM-DD format.
attendanceintegerReported attendance.
time_validlogicalTime valid.
neutral_sitelogicalNeutral site.
conference_competitionlogicalConference competition.
recentlogicalRecent.
start_datecharacterStart date (YYYY-MM-DD).
notes_typecharacterNotes type.
notes_headlinecharacterNotes headline.
type_idcharacterType identifier (numeric).
type_abbreviationcharacterType abbreviation.
venue_idcharacterUnique venue identifier.
venue_full_namecharacterVenue full name.
venue_address_citycharacterVenue address city.
venue_address_statecharacterVenue address state / region.
venue_capacityintegerVenue seating capacity.
venue_indoorlogicalTRUE if the venue is indoors.
status_clocknumericStatus clock.
status_display_clockcharacterStatus display clock.
status_periodintegerStatus period.
status_type_idcharacterUnique 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_periodsintegerFormat regulation periods.
home_idcharacterUnique 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_idcharacterUnique identifier for home venue.
home_logocharacterHome team logo URL.
home_conference_idcharacterUnique identifier for home conference.
home_scorecharacterHome team score at the time of the play.
home_winnerlogicalHome team's winner.
away_idcharacterUnique 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_idcharacterUnique identifier for away venue.
away_logocharacterAway team logo URL.
away_conference_idcharacterUnique identifier for away conference.
away_scorecharacterAway team score at the time of the play.
away_winnerlogicalAway team's winner.
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.
groups_idcharacterUnique identifier for groups.
groups_namecharacterGroups name.
groups_short_namecharacterGroups short name.
groups_is_conferencelogicalGroups is conference.
tournament_idnumericUnique identifier for tournament.
game_date_timePOSIXctGame start date/time (ISO 8601).
game_dateDateGame date (YYYY-MM-DD).
PBPlogical
team_boxlogicalTeam box.
player_boxlogicalPlayer box.

Examples

# \donttest{
load_mbb_schedule(seasons = most_recent_mbb_season())
#> ── ESPN MBB Schedule from hoopR data repository ───────────────── hoopR 3.1.0 ──
#>  Data updated: 2026-04-30 11:55:01 UTC
#> # A tibble: 6,318 × 87
#>         id uid   date  attendance time_valid neutral_site conference_competition
#>      <int> <chr> <chr>      <dbl> <lgl>      <lgl>        <lgl>                 
#>  1  4.02e8 s:40… 2026…      70720 TRUE       TRUE         FALSE                 
#>  2  4.02e8 s:40… 2026…       9670 TRUE       TRUE         FALSE                 
#>  3  4.02e8 s:40… 2026…       3109 TRUE       TRUE         FALSE                 
#>  4  4.02e8 s:40… 2026…      72111 TRUE       TRUE         FALSE                 
#>  5  4.02e8 s:40… 2026…      72111 TRUE       TRUE         FALSE                 
#>  6  4.02e8 s:40… 2026…       2947 TRUE       TRUE         FALSE                 
#>  7  4.02e8 s:40… 2026…       2947 TRUE       TRUE         FALSE                 
#>  8  4.02e8 s:40… 2026…          0 TRUE       TRUE         FALSE                 
#>  9  4.02e8 s:40… 2026…       4625 TRUE       TRUE         FALSE                 
#> 10  4.02e8 s:40… 2026…       2310 TRUE       TRUE         FALSE                 
#> # ℹ 6,308 more rows
#> # ℹ 80 more variables: play_by_play_available <lgl>, recent <lgl>,
#> #   start_date <chr>, broadcast <chr>, highlights <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>, …
# }