Description Usage Arguments Value Examples
View source: R/scrape_games_and_urls.R
This function returns all available game ids for a given season, with an option specifying which type of game ids to return (either the pre, regular, or post season) as well as the weeks considered.
1 | scrape_game_ids(season, type = "reg", weeks = NULL, teams = NULL)
|
season |
Numeric 4-digit year associated with an NFL season |
type |
String indicating the type of game ids to find, must either be "pre", "reg", or "post" (default is "reg"). |
weeks |
Numeric vector indicating which weeks of preseason (0 to 4 except for 2011 season without Hall of Fame game) or regular season games (1 to 17) to grab (default value of NULL corresponds to selecting all available weeks). |
teams |
String vector indicating which teams (based on the abbreviation) the function should grab game info for (default value of NULL corresponds to selecting all available teams). |
Data frame with columns containing the season type, game_id, week number (if pre or regular season), the year of the season, home team, away team, a variable indicating the state of the game (POST is over, PRE is before or during), game's url, and the home and away team scores if the game is over.
1 2 | # Scraping all game ids from 2017 regular season:
scrape_game_ids(2017)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.