get_player_stats_individual: Gets bio information and career statistics for specified...

Description Usage Arguments Examples

View source: R/get_player_stats_individual.R

Description

Returns a data frame of players, their bio information (age, birth place, etc.), and career statistics for user supplied player URLs and names.

Usage

1
2
get_player_stats_individual(..., progress = TRUE,
  strip_redundancy = TRUE, other = "")

Arguments

...

Function requires a player_url and name. Additional data may be supplied. All of this information comes directly from get_player_stats_team() and get_teams() or get_drafts(), if desired.

progress

Sets a Progress Bar. Defaults to TRUE.

strip_redundancy

Removes variables name_, player_url_, and position_, as they're the same as name, player_url, and position. Defaults to TRUE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# The function works in conjunction with get_teams() and get_player_stats_team()
teams <- get_teams("ohl", 2018)
stats_team <- get_player_stats_team(teams)
get_player_stats_individual(stats_team)

# The function also works in conjunction with get_drafts()
drafts <- get_drafts("nhl entry draft", 2018)
get_player_stats_individual(drafts)

# All functions are easily pipeable too
get_teams(c("shl", "allsvenskan"), 2009:2011) %>%
  get_player_stats_team(progress = TRUE) %>%
  get_player_stats_individual(strip_redundancy = FALSE)
  
# It's also easy to get player stats & bio information for only 1 team   
get_teams("ncaa iii", 2018) %>%
  filter(team == "Hamilton College") %>%
  get_player_stats_team() %>%
  get_player_stats_individual()
  
# Once you have your data, use tidyr::unnest() to view players' career statistics
get_teams("ncaa iii", 2015) %>%
  filter(team == "Hamilton College") %>%
  get_player_stats_team() %>%
  get_player_stats_individual() %>%
  tidyr::unnest(player_statistics)
  

eoppe1022/elite documentation built on Nov. 15, 2019, 6:47 a.m.