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_nba_team_box(
  seasons = most_recent_nba_season(),
  ...,
  dbConnection = NULL,
  tablename = NULL
)

Arguments

seasons

A vector of 4-digit years associated with given NBA seasons. (Min: 2002)

...

Additional arguments passed to an underlying function that writes the season data into a database (used by update_nba_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_nba_team_box(seasons = most_recent_nba_season())
#> ── ESPN NBA Team Box Information from hoopR data repository ────────────────────
#>  Data updated: 2023-03-24 10:18:14 UTC
#> # A tibble: 2,194 × 43
#>    team_id team_uid       team_slug    team_location team_name team_abbreviation
#>    <chr>   <chr>          <chr>        <chr>         <chr>     <chr>            
#>  1 25      s:40~l:46~t:25 oklahoma-ci… Oklahoma City Thunder   OKC              
#>  2 12      s:40~l:46~t:12 la-clippers  LA            Clippers  LAC              
#>  3 30      s:40~l:46~t:30 charlotte-h… Charlotte     Hornets   CHA              
#>  4 3       s:40~l:46~t:3  new-orleans… New Orleans   Pelicans  NO               
#>  5 5       s:40~l:46~t:5  cleveland-c… Cleveland     Cavaliers CLE              
#>  6 17      s:40~l:46~t:17 brooklyn-ne… Brooklyn      Nets      BKN              
#>  7 18      s:40~l:46~t:18 new-york-kn… New York      Knicks    NY               
#>  8 19      s:40~l:46~t:19 orlando-mag… Orlando       Magic     ORL              
#>  9 21      s:40~l:46~t:21 phoenix-suns Phoenix       Suns      PHX              
#> 10 13      s:40~l:46~t:13 los-angeles… Los Angeles   Lakers    LAL              
#> # ℹ 2,184 more rows
#> # ℹ 37 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>, …
# }