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(2021)
#> ───────────────────────────────────────────────────────────────── hoopR 1.8.0 ──
#> # A tibble: 26,436 × 35
#> athlete_display_n… team_short_disp… min fg fg3 ft oreb dreb reb
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 Aaron Gordon Magic 16 4-7 1-2 3-3 1 2 3
#> 2 Nikola Vucevic Magic 25 8-14 2-7 0-1 1 10 11
#> 3 Markelle Fultz Magic 25 4-7 1-3 1-2 0 3 3
#> 4 Evan Fournier Magic 25 5-9 2-5 1-1 0 1 1
#> 5 Dwayne Bacon Magic 22 6-9 1-3 1-1 0 2 2
#> 6 Chuma Okeke Magic 14 3-8 2-5 1-2 1 2 3
#> 7 Robert Franks Magic 8 0-2 0-2 5-8 0 0 0
#> 8 Gary Clark Magic 18 0-2 0-2 2-2 0 3 3
#> 9 Khem Birch Magic 18 3-4 0-0 2-3 3 5 8
#> 10 Jon Teske Magic 5 0-0 0-0 0-0 2 2 4
#> # … with 26,426 more rows, and 26 more variables: 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>,
#> # team_color <chr>, game_id <int>, season <int>, season_type <int>, …
# }