scrape_json_play_by_play: Scrape an individual game's JSON play-by-play data from...

Description Usage Arguments Value Examples

View source: R/scrape_play_by_play.R

Description

This function returns the play-by-play data available from NFL.com's JSON feed (for games starting in 2009).

Usage

1
scrape_json_play_by_play(game_id, check_url = 1)

Arguments

game_id

Ten digit game id (either numeric or character) associated with a given NFL game.

check_url

Indicator for whether or not to check if the game's url exists (default is 1, meaning yes). This is used to work with the scrape_season_play_by_play function that will perform its own check prior to scraping individual games.

Value

Data frame where each individual row represents a single play in the game containing the following detailed information:

Examples

1
2
3
4
5
6
# Scrape the play-by-play data for the 2017 Super Bowl by first getting all
# of the post-season game ids then use the required info to scrape the 
# play-by-play data (knowing that it's the last game):
playoff_game_ids_17 <- scrape_game_ids(2017, type = "post")
sb_17_id <- playoff_game_ids_17$game_id[nrow(playoff_game_ids_17)]
sb_17_pbp <- scrape_json_play_by_play(game_id = sb_17_id)

maksimhorowitz/nflscrapR documentation built on April 3, 2020, 7:40 p.m.