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_player_box( seasons = most_recent_nhl_season(), ..., dbConnection = NULL, tablename = NULL )
seasons | A vector of 4-digit years associated with given NHL seasons. (Min: 2002) |
---|---|
... | Additional arguments passed to an underlying function that writes
the season data into a database (used by |
dbConnection | A |
tablename | The name of the player box data table within the database |
Returns a tibble
# \donttest{ load_nhl_player_box(2021) #> # A tibble: 36,276 × 48 #> id full_name link shoots_catches roster_status jersey_number code name #> <int> <chr> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 8.47e6 Kris Let… /api… R Y 58 D Defe… #> 2 8.48e6 Teddy Bl… /api… L Y 53 C Cent… #> 3 8.48e6 Cody Ceci /api… R Y 4 D Defe… #> 4 8.48e6 Marcus P… /api… L Y 28 D Defe… #> 5 8.48e6 John Mar… /api… R Y 6 D Defe… #> 6 8.48e6 Brian Du… /api… L Y 8 D Defe… #> 7 8.47e6 Sidney C… /api… L N 87 C Cent… #> 8 8.48e6 Mike Mat… /api… L Y 5 D Defe… #> 9 8.48e6 Jake Gue… /api… L Y 59 L Left… #> 10 8.48e6 Jason Zu… /api… L Y 16 L Left… #> # … with 36,266 more rows, and 40 more variables: type <chr>, #> # abbreviation <chr>, skater_stats_time_on_ice <chr>, #> # skater_stats_assists <int>, skater_stats_goals <int>, #> # skater_stats_shots <int>, skater_stats_hits <int>, #> # skater_stats_power_play_goals <int>, skater_stats_power_play_assists <int>, #> # skater_stats_penalty_minutes <int>, skater_stats_face_off_wins <int>, #> # skater_stats_faceoff_taken <int>, skater_stats_takeaways <int>, … # }