View source: R/tidy_schedules.R
tidy_schedules | R Documentation |
The function tidy_schedules()
is meant to be a user-friendly way of getting NHL schedules,
including the final score and shot counts of completed games.
tidy_schedules(
seasons_id,
expand_periods = FALSE,
regular = TRUE,
playoffs = TRUE,
tz = Sys.timezone(),
keep_id = FALSE,
return_datatable = getOption("tidynhl.data.table", TRUE)
)
seasons_id |
Character vector of the seasons ID for which the schedule will be returned. The required format is 'xxxxyyyy'. |
expand_periods |
(optional) Logical indicating if data should be expanded at the period
level. Default to |
regular |
(optional) Logical indicating if the regular season schedules should be
returned. Default to |
playoffs |
(optional) Logical indicating if the playoffs schedules should be returned.
Default to |
tz |
(optional) Character specifying the timezone that should be used for datetime. Default to the user system time zone. |
keep_id |
(optional) Logical indicating if the IDs of different dimensions should be
returned. Default to |
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 the schedule of the 2019-2020 regular season and playoffs
tidy_schedules("20192020")
# Get the regular season periods of both the 2018-2019 and 2019-2020 seasons, keeping the IDs
# and indicating game datetime with Los Angeles local time
tidy_schedules(
seasons_id = c("20182019", "20192020"),
expand_periods = TRUE,
playoffs = FALSE,
tz = "America/Los_Angeles",
keep_id = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.