Skip to content

Commit

Permalink
allow season filter in missing_raw_pbp
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcaseb committed Feb 26, 2024
1 parent 8df5c6b commit 528963a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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
4 changes: 3 additions & 1 deletion R/save_raw_pbp.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#'
Expand All @@ -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 \\
Expand All @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions man/missing_raw_pbp.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 528963a

Please sign in to comment.