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

Examples

# \donttest{
  load_mbb_team_box(seasons = most_recent_nba_season())
#> ── ESPN MBB Team Boxscore Information from hoopR data repository ───────────────
#>  Data updated: 2023-03-24 09:25:17 UTC
#> # A tibble: 12,412 × 40
#>    team_id team_uid         team_slug  team_location team_name team_abbreviation
#>    <chr>   <chr>            <chr>      <chr>         <chr>     <chr>            
#>  1 350     s:40~l:41~t:350  unc-wilmi… UNC Wilmingt… Seahawks  UNCW             
#>  2 153     s:40~l:41~t:153  north-car… North Caroli… Tar Heels UNC              
#>  3 2454    s:40~l:41~t:2454 north-flo… North Florida Ospreys   UNF              
#>  4 2250    s:40~l:41~t:2250 gonzaga-b… Gonzaga       Bulldogs  GONZ             
#>  5 2458    s:40~l:41~t:2458 northern-… Northern Col… Bears     UNCO             
#>  6 248     s:40~l:41~t:248  houston-c… Houston       Cougars   HOU              
#>  7 47      s:40~l:41~t:47   howard-bi… Howard        Bison     HOW              
#>  8 96      s:40~l:41~t:96   kentucky-… Kentucky      Wildcats  UK               
#>  9 2400    s:40~l:41~t:2400 mississip… Mississippi … Delta De… MVSU             
#> 10 239     s:40~l:41~t:239  baylor-be… Baylor        Bears     BAY              
#> # ℹ 12,402 more rows
#> # ℹ 34 more variables: team_display_name <chr>, team_short_display_name <chr>,
#> #   team_color <chr>, team_alternate_color <chr>, team_logo <chr>,
#> #   field_goals_made_field_goals_attempted <chr>, field_goal_pct <chr>,
#> #   three_point_field_goals_made_three_point_field_goals_attempted <chr>,
#> #   three_point_field_goal_pct <chr>,
#> #   free_throws_made_free_throws_attempted <chr>, free_throw_pct <chr>, …
# }