View source: R/tidy_games_goals.R
tidy_games_goals | R Documentation |
The function tidy_games_goals()
is meant to be a user-friendly way of getting data about goals
in selected NHL games.
tidy_games_goals(
games_id,
include_shootout = FALSE,
time_elapsed = TRUE,
standardized_coordinates = TRUE,
keep_id = FALSE,
return_datatable = getOption("tidynhl.data.table", TRUE)
)
games_id |
Integer vector indicating the NHL ID of selected games for which the goal data will be returned. The required format is 'xxxxyyzzzz' where
|
include_shootout |
(optional) Logical indicating if shootout goals should be returned in
the data. Default to |
time_elapsed |
(optional) Logical indicating if the time sould be indicated as elapsed
( |
standardized_coordinates |
(optional) Logical indicating if the ice coordinates should be
standardized (away team zone negative on the x-axis) or kept as is. Default to |
keep_id |
(optional) Logical indicating if the IDs of different dimensions should be
returned. However, note that |
return_datatable |
(optional) Logical indicating whether or not a data.table should be
returned. Default can be set globally with |
# Allowing large outputs for the pkgdown website
options(width = 1000L)
# Get goal data of the 2021-01-13 MTL @ TOR game
tidy_games_goals(2020020003L)
# Get goal data of both the 2021-01-13 MTL @ TOR and 2021-01-14 BOS @ NJD games with time
# remaining instead of time elapsed, as is coordinates instead of normalized, including shootout
# goals, and keeping the IDs
tidy_games_goals(
games_id = c(2020020003L, 2020020007L),
include_shootout = TRUE,
time_elapsed = FALSE,
standardized_coordinates = FALSE,
keep_id = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.