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

Arguments

seasons

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

...

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 team box data table within the database

Value

Returns a tibble

Examples

# \donttest{
  try(load_wnba_team_box())
#> ──────────────────────────────────────────────────────────────── wehoop 1.7.0 ──
#> # A tibble: 478 × 40
#>    team_id team_uid      team_…¹ team_…² team_…³ team_…⁴ team_…⁵ team_…⁶ team_…⁷
#>    <chr>   <chr>         <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr>  
#>  1 18      s:40~l:59~t:… connec… Connec… Sun     CONN    Connec… Sun     de6b36 
#>  2 17      s:40~l:59~t:… las-ve… Las Ve… Aces    LV      Las Ve… Aces    000000 
#>  3 18      s:40~l:59~t:… connec… Connec… Sun     CONN    Connec… Sun     de6b36 
#>  4 17      s:40~l:59~t:… las-ve… Las Ve… Aces    LV      Las Ve… Aces    000000 
#>  5 18      s:40~l:59~t:… connec… Connec… Sun     CONN    Connec… Sun     de6b36 
#>  6 19      s:40~l:59~t:… chicag… Chicago Sky     CHI     Chicag… Sky     4f91cd 
#>  7 17      s:40~l:59~t:… las-ve… Las Ve… Aces    LV      Las Ve… Aces    000000 
#>  8 14      s:40~l:59~t:… seattl… Seattle Storm   SEA     Seattl… Storm   05452a 
#>  9 19      s:40~l:59~t:… chicag… Chicago Sky     CHI     Chicag… Sky     4f91cd 
#> 10 18      s:40~l:59~t:… connec… Connec… Sun     CONN    Connec… Sun     de6b36 
#> # … with 468 more rows, 31 more variables: 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>,
#> #   total_rebounds <chr>, offensive_rebounds <chr>, defensive_rebounds <chr>, …
# }