From 1393ef0cef5f1c1f630ae556aad42b9737ef3167 Mon Sep 17 00:00:00 2001 From: Kiernan Nicholls Date: Thu, 16 Sep 2021 12:34:54 -0400 Subject: [PATCH] Update `team_roster()` arguments --- R/roster.R | 6 +++--- man/team_roster.Rd | 6 +----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/R/roster.R b/R/roster.R index 1b73650c..384b3788 100644 --- a/R/roster.R +++ b/R/roster.R @@ -7,14 +7,14 @@ #' team_roster(leagueId = "42654852") #' @return A dataframe (or list) with league teams. #' @export -team_roster <- function(leagueId = ffl_id(), seasonId = 2021, - leagueHistory = FALSE, ...) { +team_roster <- function(leagueId = ffl_id(), leagueHistory = FALSE, ...) { dat <- ffl_api( leagueId = leagueId, - view = "mRoster", leagueHistory = leagueHistory, + view = "mRoster", ... ) + stop_predraft(dat) if (leagueHistory) { lapply(dat$teams, function(x) lapply(x$roster$entries, out_roster)) } else { diff --git a/man/team_roster.Rd b/man/team_roster.Rd index 58462081..bf54aeb0 100644 --- a/man/team_roster.Rd +++ b/man/team_roster.Rd @@ -4,16 +4,12 @@ \alias{team_roster} \title{Fantasy team rosters} \usage{ -team_roster(leagueId = ffl_id(), seasonId = 2021, leagueHistory = FALSE, ...) +team_roster(leagueId = ffl_id(), leagueHistory = FALSE, ...) } \arguments{ \item{leagueId}{Numeric league ID or ESPN fantasy page URL. Defaults to \code{getOption("fflr.leagueId")}. Function fails if no ID is found.} -\item{seasonId}{Integer year of NFL season. By default, the season is -currently set to 2021. Use a recent year or set \code{leagueHistory} to \code{TRUE} -to obtain all past data.} - \item{leagueHistory}{logical; Should the \code{leagueHistory} version of the API be called? If \code{TRUE}, a list of results is returned, with one element for each historical year of the league.}