Learn R Programming

nflfastR (version 4.3.0)

build_nflfastR_pbp: Build a Complete nflfastR Data Set

Description

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.

Usage

build_nflfastR_pbp(game_ids, ..., decode = TRUE, rules = TRUE)

Value

An nflfastR play-by-play data frame like it can be loaded from https://github.com/nflverse/nflfastR-data.

Arguments

game_ids

Vector of character ids or a data frame including the variable game_id (see details for further information).

...

Additional arguments passed to the scraping functions (for internal use)

decode

If TRUE, the function decode_player_ids() will be executed.

rules

If FALSE, printing of the header and footer in the console output will be suppressed.

Details

To load valid game_ids please use the package function fast_scraper_schedules().

See Also

For information on parallel processing and progress updates please see nflfastR.

Examples

Run this code
# \donttest{
# Build nflfastR pbp for the 2018 and 2019 Super Bowls
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
library(dplyr, warn.conflicts = FALSE)
fast_scraper_schedules(2020) %>%
  tail(3) %>%
  build_nflfastR_pbp()

# \dontshow{
# Close open connections for R CMD Check
future::plan("sequential")
# }
# }

Run the code above in your browser using DataLab