tidy_skaters_gamelogs: Get a tidy dataset of NHL skaters game logs

View source: R/tidy_skaters_gamelogs.R

tidy_skaters_gamelogsR Documentation

Get a tidy dataset of NHL skaters game logs

Description

The function tidy_skaters_gamelogs() is meant to be a user-friendly way of getting the NHL game logs of selected skaters.

Usage

tidy_skaters_gamelogs(
  players_id,
  seasons_id = NULL,
  regular = TRUE,
  playoffs = TRUE,
  tz = Sys.timezone(),
  keep_id = FALSE,
  return_datatable = getOption("tidynhl.data.table", TRUE)
)

Arguments

players_id

Integer vector indicating the NHL ID of skaters for whom the game logs will be returned.

seasons_id

(optional) Character vector indicating the seasons for which the game logs will be returned. The required format for each character is 'xxxxyyyy'. Default to NULL which will return the full career game logs for each player.

regular

(optional) Logical indicating if the regular season game logs should be returned. Default to TRUE.

playoffs

(optional) Logical indicating if the playoffs game logs should be returned. Default to TRUE.

tz

(optional) Character specifying the timezone that should be used for datetime. Default to the user system timezone.

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 the NHL career game logs of Vincent Lecavalier
tidy_skaters_gamelogs(8467329L)

# Get the 2010-11 NHL playoffs game logs of both Vincent Lecavalier and Martin St. Louis,
# keeping the IDs
tidy_skaters_gamelogs(
  players_id = c(8467329L, 8466378L),
  seasons_id = "20102011",
  regular = FALSE,
  keep_id = TRUE
)


jplecavalier/tidynhl documentation built on July 28, 2024, 3:48 a.m.