The function tidy_players_meta() is meant to be a user-friendly way of getting metadata about the selected players.

tidy_players_meta(
  players_id = NULL,
  keep_id = FALSE,
  return_datatable = getOption("tidynhl.data.table", TRUE)
)

Arguments

players_id

(optional) Integer vector indicating the NHL ID of players for whom the metadata will be returned. Default to NULL which will return every players in the NHL database.

keep_id

(optional) Logical indicating if the IDs of different dimensions should be returned. Default to FALSE.

return_datatable

(optional) Logical indicating whether or not a data.table should be returned. Default can be set globally with options("tidynhl.data.table").

Examples

# Allowing large outputs for the pkgdown website options(width = 1000L) # Get metadata of every players in the NHL database tidy_players_meta()
#> player_name player_active player_roster_status player_number player_position player_position_type player_nationality player_birth_country player_birth_stateprovince player_birth_city player_birth_date player_dead player_death_date player_inches player_pounds player_hand player_rookie player_hof player_hof_year player_nhl_100 team_abbreviation #> 1: Henry Harris FALSE N 12 R F CAN CAN ON Kenora 1906-04-28 TRUE <NA> 71 185 L FALSE FALSE NA FALSE <NA> #> 2: Gordon Spence FALSE N 12 L F CAN CAN ON Haileybury 1897-07-25 TRUE <NA> 67 150 L FALSE FALSE NA FALSE <NA> #> 3: Ron Hudson FALSE N 15 C F CAN CAN AB Calgary 1911-07-14 TRUE 1984-10-11 68 148 L FALSE FALSE NA FALSE <NA> #> 4: Norm Johnson FALSE N 6 C F CAN CAN SK Moose Jaw 1932-11-27 TRUE <NA> 70 170 L FALSE FALSE NA FALSE <NA> #> 5: Reg Abbott FALSE N 4 C F CAN CAN MB Winnipeg 1930-02-04 FALSE <NA> 71 164 L FALSE FALSE NA FALSE <NA> #> --- #> 20599: Tyler Johnson FALSE N NA G G USA USA NY AMHERST 1998-02-07 FALSE <NA> 76 192 R FALSE NA NA FALSE <NA> #> 20600: Cody Karpinski FALSE N NA G G USA USA IL CHICAGO 1992-06-16 FALSE <NA> 73 192 L FALSE NA NA FALSE <NA> #> 20601: Dominic Cormier FALSE N NA D D CAN CAN NB MONCTON 1998-01-02 FALSE <NA> 71 181 L FALSE NA NA FALSE <NA> #> 20602: Matthew Miller FALSE N NA D D USA USA OH EAST PALESTINE 1995-08-22 FALSE <NA> 73 204 L FALSE NA NA FALSE <NA> #> 20603: Jack Duff FALSE N NA D D <NA> CAN ON KINGSTON 2000-01-23 FALSE <NA> 75 220 R FALSE NA NA FALSE <NA>
# Get metadata about both Vincent Lecavalier and Carey Price, keeping the IDs tidy_players_meta(players_id = c(8467329L, 8471679L), keep_id = TRUE)
#> player_id player_name player_active player_roster_status player_number player_position player_position_type player_nationality player_birth_country player_birth_stateprovince player_birth_city player_birth_date player_dead player_death_date player_inches player_pounds player_hand player_rookie player_hof player_hof_year player_nhl_100 team_id team_abbreviation #> 1: 8467329 Vincent Lecavalier FALSE N 44 C F CAN CAN QC Ile Bizard 1980-04-21 FALSE <NA> 76 215 L FALSE FALSE NA FALSE NA <NA> #> 2: 8471679 Carey Price TRUE Y 31 G G CAN CAN BC Anahim Lake 1987-08-16 FALSE <NA> 75 220 L FALSE FALSE NA FALSE 8 MTL