Learn R Programming

nflscrapR (version 1.4.0)

season_games: Game Information for All Games in a Season

Description

This function intakes a year associated with a given season and outputs all the game matchups for all 17 weeks of the regular season

Usage

season_games(Season, sleep.seconds = 0)

Arguments

Season

(numeric): A 4-digit year associated with a given NFL season

sleep.seconds

(numeric): Allows the user to tell the function to sleep between calls to the API to avoid disrupting the connection. Note, this will make the function take much longer.

Week

(numeric): A number corresponding to the number of weeks of data you want to be scraped and included in the output.

Value

A dataframe with the gameID, the game date, the home team abbreviation, and away team abbreviation

Details

Reference the stored dataframe nflteams to match team abbreviations with the full team names

Examples

Run this code
# NOT RUN {
# All games in 2015 Season
season_games(2015) # Will output a dataframe
# }

Run the code above in your browser using DataLab