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_nametypes
idinteger
uidcharacter
datecharacter
attendanceinteger
time_validlogical
neutral_sitelogical
conference_competitionlogical
recentlogical
start_datecharacter
notes_typecharacter
notes_headlinecharacter
type_idcharacter
type_abbreviationcharacter
venue_idcharacter
venue_full_namecharacter
venue_address_citycharacter
venue_address_statecharacter
venue_capacityinteger
venue_indoorlogical
status_clocknumeric
status_display_clockcharacter
status_periodinteger
status_type_idcharacter
status_type_namecharacter
status_type_statecharacter
status_type_completedlogical
status_type_descriptioncharacter
status_type_detailcharacter
status_type_short_detailcharacter
format_regulation_periodsinteger
home_idcharacter
home_uidcharacter
home_locationcharacter
home_namecharacter
home_abbreviationcharacter
home_display_namecharacter
home_short_display_namecharacter
home_colorcharacter
home_alternate_colorcharacter
home_is_activelogical
home_venue_idcharacter
home_logocharacter
home_conference_idcharacter
home_scorecharacter
home_winnerlogical
away_idcharacter
away_uidcharacter
away_locationcharacter
away_namecharacter
away_abbreviationcharacter
away_display_namecharacter
away_short_display_namecharacter
away_colorcharacter
away_alternate_colorcharacter
away_is_activelogical
away_venue_idcharacter
away_logocharacter
away_conference_idcharacter
away_scorecharacter
away_winnerlogical
game_idinteger
seasoninteger
season_typeinteger
status_type_alt_detailcharacter
groups_idcharacter
groups_namecharacter
groups_short_namecharacter
groups_is_conferencelogical
tournament_idnumeric
game_date_timePOSIXct
game_dateDate
PBPlogical
team_boxlogical
player_boxlogical

Examples

# \donttest{
load_mbb_schedule(seasons = most_recent_mbb_season())
#> ── ESPN MBB Schedule from hoopR data repository ───────────────── hoopR 2.1.0 ──
#>  Data updated: 2023-11-28 11:13:24 UTC
#> # A tibble: 5,808 × 85
#>         id uid   date  attendance time_valid neutral_site conference_competition
#>      <int> <chr> <chr>      <dbl> <lgl>      <lgl>        <lgl>                 
#>  1  4.02e8 s:40… 2024…          0 TRUE       FALSE        TRUE                  
#>  2  4.02e8 s:40… 2024…          0 TRUE       FALSE        TRUE                  
#>  3  4.02e8 s:40… 2024…          0 TRUE       FALSE        TRUE                  
#>  4  4.02e8 s:40… 2024…          0 TRUE       FALSE        TRUE                  
#>  5  4.02e8 s:40… 2024…          0 TRUE       FALSE        TRUE                  
#>  6  4.02e8 s:40… 2024…          0 TRUE       FALSE        TRUE                  
#>  7  4.02e8 s:40… 2024…          0 TRUE       FALSE        TRUE                  
#>  8  4.02e8 s:40… 2024…          0 TRUE       FALSE        TRUE                  
#>  9  4.02e8 s:40… 2024…          0 TRUE       FALSE        TRUE                  
#> 10  4.02e8 s:40… 2024…          0 TRUE       FALSE        TRUE                  
#> # ℹ 5,798 more rows
#> # ℹ 78 more variables: play_by_play_available <lgl>, recent <lgl>,
#> #   start_date <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_capacity <dbl>,
#> #   venue_indoor <lgl>, status_clock <dbl>, status_display_clock <chr>, …
# }