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

load_nhl_team_box(
  seasons = most_recent_nhl_season(),
  ...,
  dbConnection = NULL,
  tablename = NULL
)

Arguments

seasons

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

...

Additional arguments passed to an underlying function that writes the season data into a database (used by update_nhl_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{
load_nhl_team_box(2021)
#> # A tibble: 1,904 × 16
#>    team_id team_name           link       abbreviation triCode goals   pim shots
#>      <int> <chr>               <chr>      <chr>        <chr>   <int> <int> <int>
#>  1       5 Pittsburgh Penguins /api/v1/t… PIT          PIT         3     6    34
#>  2       4 Philadelphia Flyers /api/v1/t… PHI          PHI         6     6    27
#>  3       8 Montréal Canadiens  /api/v1/t… MTL          MTL         4    13    32
#>  4      10 Toronto Maple Leafs /api/v1/t… TOR          TOR         5    11    34
#>  5      16 Chicago Blackhawks  /api/v1/t… CHI          CHI         1     8    23
#>  6      14 Tampa Bay Lightning /api/v1/t… TBL          TBL         5     6    33
#>  7      23 Vancouver Canucks   /api/v1/t… VAN          VAN         5     8    35
#>  8      22 Edmonton Oilers     /api/v1/t… EDM          EDM         3     4    31
#>  9      19 St. Louis Blues     /api/v1/t… STL          STL         4     8    32
#> 10      21 Colorado Avalanche  /api/v1/t… COL          COL         1     4    27
#> # … with 1,894 more rows, and 8 more variables: powerPlayPercentage <chr>,
#> #   powerPlayGoals <int>, powerPlayOpportunities <int>,
#> #   faceOffWinPercentage <chr>, blocked <int>, takeaways <int>,
#> #   giveaways <int>, hits <int>
# }