Skip to content

Commit be3d866

Browse files
committed
in input folder: check for correct file extension
1 parent 719c92d commit be3d866

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

R/NEW_00_main_CalibraCurve.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ CalibraCurve <- function(data_path = NULL,
139139
if (is.null(data_path)) { # if folder (with potentially multiple files) is given
140140
#### TODO: hier müsste nach relevanten files (xlsx, csv, usw) gefiltert werden
141141
all_files <- setdiff(list.files(path = data_folder), list.dirs(path = data_folder, recursive = FALSE, full.names = FALSE))
142-
print(all_files)
143142

144143
filetable <- data.frame(file = all_files) %>%
145144
dplyr::rowwise() %>%
@@ -152,12 +151,13 @@ CalibraCurve <- function(data_path = NULL,
152151
filetable <- data.frame(file = all_files) %>%
153152
dplyr::rowwise() %>%
154153
dplyr::mutate(substance_name = strsplit(basename(file), "\\.")[[1]][1],
155-
full_path = file)
154+
full_path = file,
155+
file_ext = tools::file_ext(file))
156156
}
157157

158-
159158
### check if all files are valid (correct file type)
160159

160+
all_files <- all_files[all_files$file_ext == filetype,]
161161

162162

163163

0 commit comments

Comments
 (0)