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

Arguments

seasons

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

...

Additional arguments passed to an underlying function that writes the season data into a database (used by update_wnba_db()).

dbConnection

A DBIConnection object, as returned by DBI::dbConnect()

tablename

The name of the player box data table within the database

Value

Returns a tibble

Examples

# \donttest{
  try(load_wnba_player_box())
#> ──────────────────────────────────────────────────────────────── wehoop 2.1.0 ──
#> # A tibble: 3,352 × 57
#>      game_id season season_type game_date  game_date_time      athlete_id
#>        <int>  <int>       <int> <date>     <dttm>                   <int>
#>  1 401620458   2024           2 2024-07-20 2024-07-20 20:30:00    2998928
#>  2 401620458   2024           2 2024-07-20 2024-07-20 20:30:00    3149391
#>  3 401620458   2024           2 2024-07-20 2024-07-20 20:30:00        585
#>  4 401620458   2024           2 2024-07-20 2024-07-20 20:30:00    2529122
#>  5 401620458   2024           2 2024-07-20 2024-07-20 20:30:00    2987869
#>  6 401620458   2024           2 2024-07-20 2024-07-20 20:30:00    2529140
#>  7 401620458   2024           2 2024-07-20 2024-07-20 20:30:00    3917450
#>  8 401620458   2024           2 2024-07-20 2024-07-20 20:30:00    2490553
#>  9 401620458   2024           2 2024-07-20 2024-07-20 20:30:00    2998938
#> 10 401620458   2024           2 2024-07-20 2024-07-20 20:30:00    3065570
#> # ℹ 3,342 more rows
#> # ℹ 51 more variables: athlete_display_name <chr>, team_id <int>,
#> #   team_name <chr>, team_location <chr>, team_short_display_name <chr>,
#> #   minutes <dbl>, field_goals_made <int>, field_goals_attempted <int>,
#> #   three_point_field_goals_made <int>,
#> #   three_point_field_goals_attempted <int>, free_throws_made <int>,
#> #   free_throws_attempted <int>, offensive_rebounds <int>, …
# }