From 96fa7de9514f5c58c83b0d8d08694072091e9ce3 Mon Sep 17 00:00:00 2001 From: Ming Yang Date: Tue, 19 Nov 2024 17:42:17 +0800 Subject: [PATCH] Remove file extensions and check duplicated file names --- R/utils.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/utils.R b/R/utils.R index 33915ac..d1a60fd 100644 --- a/R/utils.R +++ b/R/utils.R @@ -98,7 +98,11 @@ load_data_files <- function(file_paths) { return(data) }) - names(data_list) <- basename(file_paths) + names(data_list) <- tools::file_path_sans_ext(basename(file_paths)) + + if (any(duplicated(names(data_list)))) { + stop("load_data_files(): Duplicate file names detected. Please ensure all file names are unique.") + } return(data_list) }