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_player_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
Examples
# \donttest{
load_nba_player_box(seasons = most_recent_nba_season())
#> ── ESPN NBA Player Boxscore Information from hoopR data repository ─────────────
#> ℹ Data updated: 2023-03-24 10:24:08 UTC
#> # A tibble: 23,082 × 35
#> athlete_display_name team_short_display_name min fg fg3 ft oreb
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 Jaylin Williams Thunder 26 3-7 1-4 1-2 0
#> 2 Jalen Williams Thunder 32 7-12 2-4 0-0 1
#> 3 Shai Gilgeous-Alexander Thunder 27 10-15 1-1 9-9 0
#> 4 Josh Giddey Thunder 26 8-15 2-5 0-0 3
#> 5 Luguentz Dort Thunder 30 1-11 1-4 0-0 2
#> 6 Dario Saric Thunder 3 0-0 0-0 0-0 0
#> 7 Jeremiah Robinson-Earl Thunder 11 2-5 0-1 0-0 3
#> 8 Lindy Waters III Thunder 22 2-7 2-7 0-0 1
#> 9 Ousmane Dieng Thunder 16 4-6 1-1 0-0 1
#> 10 Olivier Sarr Thunder 8 1-1 1-1 0-0 1
#> # ℹ 23,072 more rows
#> # ℹ 28 more variables: dreb <chr>, reb <chr>, ast <chr>, stl <chr>, blk <chr>,
#> # to <chr>, pf <chr>, plus_minus <chr>, pts <chr>, starter <lgl>,
#> # ejected <lgl>, did_not_play <lgl>, active <lgl>, athlete_jersey <chr>,
#> # athlete_id <chr>, athlete_short_name <chr>, athlete_headshot_href <chr>,
#> # athlete_position_name <chr>, athlete_position_abbreviation <chr>,
#> # team_name <chr>, team_logo <chr>, team_id <chr>, team_abbreviation <chr>, …
# }