Skip to contents

Helper function to load play-by-play data from nflreadr for a specified time frame.

Usage

load_data_from_nflreadr(season, week_min, week_max)

Arguments

season

NFL season to obtain play-by-play data. The season can be defined as a single season, season = 2024. For multiple seasons, use either season = c(2023,2024) or season = 2022:2024.

week_min

Minimum week to define whether pulling a range of weeks or the entire season. Use week_min = 1 for the first week of the season, must be an integer.

week_max

Maximum week to define a range of weeks to pull from an NFL season. If not defined, the data will be pulled for all weeks, beginning with week_min.

Value

Dataframe containing filtered play-by-play data

Details

Helper function to load play-by-play data from nflreadr. The function filters the data to include a specified time frame including seasons and a range of weeks. If week_max is provided, filter between week_min and week_max If week_max is not provided, filter for weeks >= week_min to get the remainder of the season. This function is typically utilized if the user is not loading play-by-play data from a database.

See also

load_pbp: Load play-by-play data

get_pbp_data: Obtain filtered play-by-play data utilizes this helper function

Author

Nolan MacDonald