diff --git a/DESCRIPTION b/DESCRIPTION index f1f26695..4c02bccc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: nflfastR Title: Functions to Efficiently Access NFL Play by Play Data -Version: 4.6.1.9001 +Version: 4.6.1.9002 Authors@R: c(person(given = "Sebastian", family = "Carl", @@ -71,6 +71,6 @@ Suggests: testthat (>= 3.0.0) Encoding: UTF-8 LazyData: true -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 Roxygen: list(markdown = TRUE) Config/testthat/edition: 3 diff --git a/R/save_raw_pbp.R b/R/save_raw_pbp.R index f1993e63..980e752c 100644 --- a/R/save_raw_pbp.R +++ b/R/save_raw_pbp.R @@ -76,6 +76,7 @@ save_raw_pbp <- function(game_ids, #' This function is intended to serve as input for [save_raw_pbp()]. #' #' @inheritParams save_raw_pbp +#' @inheritParams nflreadr::load_schedules #' @param verbose If `TRUE`, will print number of missing game files as well as #' oldest and most recent missing ID to console. #' @@ -92,6 +93,7 @@ save_raw_pbp <- function(game_ids, #' ) #' } missing_raw_pbp <- function(dir = getOption("nflfastR.raw_directory", default = NULL), + seasons = TRUE, verbose = TRUE){ if(is.null(dir)){ cli::cli_abort("Invalid argument {.arg dir}. Do you need to set \\ @@ -104,7 +106,7 @@ missing_raw_pbp <- function(dir = getOption("nflfastR.raw_directory", default = unlist(use.names = FALSE) %>% tools::file_path_sans_ext() - finished_games <- nflreadr::load_schedules() %>% + finished_games <- nflreadr::load_schedules(seasons = seasons) %>% dplyr::filter(!is.na(.data$result)) %>% dplyr::pull(.data$game_id) diff --git a/man/missing_raw_pbp.Rd b/man/missing_raw_pbp.Rd index af940616..78f8ea04 100644 --- a/man/missing_raw_pbp.Rd +++ b/man/missing_raw_pbp.Rd @@ -6,6 +6,7 @@ \usage{ missing_raw_pbp( dir = getOption("nflfastR.raw_directory", default = NULL), + seasons = TRUE, verbose = TRUE ) } @@ -14,6 +15,8 @@ missing_raw_pbp( nflfastR will download the raw game files split by season into one sub directory per season.} +\item{seasons}{a numeric vector of seasons to return, default \code{TRUE} returns all available data.} + \item{verbose}{If \code{TRUE}, will print number of missing game files as well as oldest and most recent missing ID to console.} }