From 6259d741629070bdc39b7741c78156dd264564ad Mon Sep 17 00:00:00 2001 From: Nat DeFries <42820733+nmdefries@users.noreply.github.com> Date: Thu, 9 Dec 2021 18:13:02 -0500 Subject: [PATCH] apply regex to only filename, not path --- facebook/delphiFacebook/R/weights.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/facebook/delphiFacebook/R/weights.R b/facebook/delphiFacebook/R/weights.R index 050b55bc0..06f97c37c 100644 --- a/facebook/delphiFacebook/R/weights.R +++ b/facebook/delphiFacebook/R/weights.R @@ -65,7 +65,7 @@ join_weights <- function(data, params, weights = c("step1", "full")) latest_weight <- tail(weights_files, n = 1) latest_weight_date <- as.Date( - stri_extract_first(latest_weight, regex = "^[0-9]{4}-[0-9]{2}-[0-9]{2}") + stri_extract_first(basename(latest_weight), regex = "^[0-9]{4}-[0-9]{2}-[0-9]{2}") ) col_types <- c("character", "double")