From a79fd4ce887f3d16964f991d0989a49e7b522080 Mon Sep 17 00:00:00 2001 From: mrcaseb Date: Fri, 6 Sep 2024 09:31:23 +0200 Subject: [PATCH] upload current season and combined files only --- R/ngs_functions.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/R/ngs_functions.R b/R/ngs_functions.R index 58f2bb1b..364fad7d 100644 --- a/R/ngs_functions.R +++ b/R/ngs_functions.R @@ -107,6 +107,7 @@ save_ngs_type <- function(season, type = c("passing", "rushing", "receiving"), s } combine_ngs_data <- function(type){ + cli::cli_progress_step("Combining {.field {type}} data") save <- purrr::map_dfr(2016:most_recent_season(), function(x) readRDS(glue::glue("data/ngs_{x}_{type}.rds"))) attr(save, "nflverse_timestamp") <- Sys.time() @@ -121,10 +122,12 @@ combine_ngs_data <- function(type){ compress_level = 22, shuffle_control = 15 ) + cli::cli_progress_done() } upload_nflverse <- function(data_path = "data") { - list.files(path = data_path, full.names = TRUE) |> + file_pattern <- paste(most_recent_season(), "ngs_passing", "ngs_receiving", "ngs_rushing", sep = "|") + list.files(path = data_path, full.names = TRUE, pattern = file_pattern) |> nflversedata::nflverse_upload("nextgen_stats") }