Learn R Programming

nflfastR (version 3.2.0)

build_nflfastR_pbp: Build a Complete nflfastR Data Set

Description

build_nflfastR_pbp is a convenient wrapper around 5 nflfastR functions:

Please see the documentation of each function to learn about the output.

Usage

build_nflfastR_pbp(
  game_ids,
  source = "nfl",
  pp = FALSE,
  ...,
  decode = FALSE,
  rules = TRUE
)

Arguments

game_ids

Vector of character ids (see details for further information).

source

Character - nfl for the NFL.com page or old for the old gamecenter. For old, old_game_id must be supplied

pp

Logical - either TRUE or FALSE (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.

Value

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

Details

To load valid game_ids please use the package function fast_scraper_schedules.

The source parameter controls from which source the data is being loaded. The old parameters rs as well as gc are not valid anymore. Please use nfl or old.

The pp parameter controls if the scraper should use parallel processing. Please note that the initiating process takes a few seconds which means it may be better to set pp = FALSE if you are scraping just a few games.

Examples

Run this code
# NOT RUN {
# Build nflfastR pbp for the 2018 and 2019 Super Bowls
build_nflfastR_pbp(c("2018_21_NE_LA", "2019_21_SF_KC"))
# }

Run the code above in your browser using DataLab