R/helper_get_scheds_and_rosters.R

Defines functions get_scheds_and_rosters

################################################################################
# Author: Sebastian Carl
# Purpose: Function for loading schedules and rosters from nflfastR repos
# Code Style Guide: styler::tidyverse_style()
################################################################################

get_scheds_and_rosters <- function(season, type) {

  type <- match.arg(type,choices = c("schedule","roster"))

  switch(type,
         "schedule" = nflreadr::load_schedules(season),
         "roster" = nflreadr::load_rosters(season))
}

Try the nflfastR package in your browser

Any scripts or data that you put into this service are public.

nflfastR documentation built on Oct. 20, 2023, 5:14 p.m.