Helpers
Some helper functions are made available in NFLData.jl for use in loading and cleaning data. Not all helper functions that are available in {nflreadr} have been translated to NFLData.jl, such as nflreadr::join_coalesce()–these functions are general enough that they are considered beyond the scope of this package.
NFLData.gameinfo.most_recent_season — Functionmost_recent_season(roster::Bool = false)Return the most recent NFL season (including in-progress season).
If roster=true, the upcoming NFL season is returned if the system date is March 15th or later. Defaults to false.
Examples
julia> # if using Dates; today() == "2024-06-15"
julia> most_recent_season()
2023
julia> most_recent_season(true)
2024NFLData.gameinfo.get_current_week — Functionget_current_week(use_date::Bool = false)Return the current/upcoming week of the NFL season. Uses the schedules by default, can be swapped to use date-based heuristics by passing use_date=true.
Examples
julia> # if using Dates; today() == "2024-09-15"
julia>get_current_week()
2NFLData.helpers.clean_team_abbrs — Methodclean_team_abbrs(team::String; current_location::Bool = true, keep_non_matches::Bool = true)Clean abbreviations of teams to NFLverse friendly abbreviations.
Examples
julia> clean_team_abbrs("SD")
"LAC"NFLData.helpers.nflverse_game_id — Methodnflverse_game_id(season::Number,week::Number,away::String,home::String)Check and calculate an nflverse game ID.
Examples
```julia-repl julia> nflversegameid(2022, 2, "LAC", "KC") "202202LAC_KC"