get_current_week: Get Current Week

View source: R/utils_date.R

get_current_weekR Documentation

Get Current Week

Description

A helper function that returns the upcoming NFL regular season week based on either the nflverse schedules file (as found in load_schedules()) or some date-based heuristics (number of weeks since the first Monday of September)

Usage

get_current_week(use_date = FALSE)

Arguments

use_date

a logical to determine whether to use date-based heuristics to determine current week, default FALSE (i.e. uses schedule file)

Details

Note that the date heuristic will count a new week starting on Thursdays, while the schedule-based method will count a new week after the last game of the previous week, e.g. after MNF is completed. Tan and Ben argued for a while about this.

Value

current nfl regular season week as a numeric

See Also

Other Date utils: most_recent_season()

Examples

{
  
    try({ # schedules file as per default requires online access
    get_current_week()
    })
  
  # using the date method works offline
  get_current_week(use_date = TRUE)
}


nflreadr documentation built on Sept. 8, 2023, 5:57 p.m.