From a609fa781dc1d54035034b8efe236472ca34e978 Mon Sep 17 00:00:00 2001 From: David Blodgett Date: Sun, 28 Jul 2024 20:38:42 -0500 Subject: [PATCH] only check basename for dups --- R/get_nhdplushr.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/get_nhdplushr.R b/R/get_nhdplushr.R index dc4cda88..1b54e858 100644 --- a/R/get_nhdplushr.R +++ b/R/get_nhdplushr.R @@ -67,7 +67,7 @@ get_nhdplushr <- function(hr_dir, out_gpkg = NULL, gdbs <- list.files(hr_dir, pattern = "sub.gpkg", full.names = TRUE) } - dup_list_key <- regmatches(gdbs, regexpr("[0-9][0-9][0-9][0-9]", gdbs)) + dup_list_key <- regmatches(basename(gdbs), regexpr("[0-9][0-9][0-9][0-9]", basename(gdbs))) if(any(duplicated(dup_list_key))) { remove <- gdbs[duplicated(dup_list_key)]