View source: R/build_nflfastR_pbp.R
build_nflfastR_pbp | R Documentation |
build_nflfastR_pbp
is a convenient wrapper around 6 nflfastR functions:
fast_scraper()
clean_pbp()
add_qb_epa()
add_xyac()
add_xpass()
decode_player_ids()
Please see either the documentation of each function or the nflfastR Field Descriptions website to learn about the output.
build_nflfastR_pbp(
game_ids,
dir = getOption("nflfastR.raw_directory", default = NULL),
...,
decode = TRUE,
rules = TRUE
)
game_ids |
Vector of character ids or a data frame including the variable
|
dir |
Path to local directory (defaults to option "nflfastR.raw_directory")
where nflfastR searches for raw game play-by-play data.
See |
... |
Additional arguments passed to the scraping functions (for internal use) |
decode |
If |
rules |
If |
To load valid game_ids please use the package function fast_scraper_schedules()
.
An nflfastR play-by-play data frame like it can be loaded from https://github.com/nflverse/nflverse-data.
For information on parallel processing and progress updates please see nflfastR.
# Build nflfastR pbp for the 2018 and 2019 Super Bowls
try({# to avoid CRAN test problems
build_nflfastR_pbp(c("2018_21_NE_LA", "2019_21_SF_KC"))
})
# It is also possible to directly use the
# output of `fast_scraper_schedules` as input
try({# to avoid CRAN test problems
library(dplyr, warn.conflicts = FALSE)
fast_scraper_schedules(2020) |>
slice_tail(n = 3) |>
build_nflfastR_pbp()
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.