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

Arguments

seasons

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

...

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

dbConnection

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

tablename

The name of the team rosters data table within the database

Value

Returns a tibble

Examples

# \donttest{
  try(load_phf_rosters(2021))
#> ── PHF Team Roster Information from fastRhockey data repository ────────────────
#>  Data updated: 2023-01-04 07:39:33 UTC
#> # A tibble: 139 × 16
#>    team_id team_n…¹ group divis…² playe…³ playe…⁴ posit…⁵ height birth…⁶ country
#>      <int> <chr>    <lgl>   <int>   <int> <chr>   <chr>   <chr>  <chr>   <chr>  
#>  1   97010 Boston … NA      11112       2 Meagha… F       "5' 4… Jan 15… USA    
#>  2   97010 Boston … NA      11112       4 Lauren… D       "5' 7… May 2,… USA    
#>  3   97010 Boston … NA      11112       7 Mary P… F       "5' 9… Sep 2,… USA    
#>  4   97010 Boston … NA      11112       8 Taylor… D       "5' 5… Aug 14… USA    
#>  5   97010 Boston … NA      11112       9 Tori S… F       "5' 5… Aug 4,… USA    
#>  6   97010 Boston … NA      11112      12 Jenna … D       "5' 7… Jun 6,… USA    
#>  7   97010 Boston … NA      11112      13 Kaleig… D       "5' 7… Mar 24… Canada 
#>  8   97010 Boston … NA      11112      14 Jillia… F       "5' 4… Jan 19… USA    
#>  9   97010 Boston … NA      11112      16 Lexie … F       "5' 5… Jun 24… USA    
#> 10   97010 Boston … NA      11112      17 McKenn… F       "5' 6… May 18… USA    
#> # … with 129 more rows, 6 more variables: hometown <chr>, college <chr>,
#> #   player_image_href <chr>, player_href <chr>, player_id <int>, season <int>,
#> #   and abbreviated variable names ¹​team_name, ²​division_id, ³​player_jersey,
#> #   ⁴​player_name, ⁵​position, ⁶​birthdate
# }