Skip to content

Commit

Permalink
Reworking OS-agnostic file path parsing inside of read_d1_files
Browse files Browse the repository at this point in the history
  • Loading branch information
njlyon0 committed Apr 11, 2024
1 parent 10fc577 commit c0f8a63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/read_d1_files.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ read_d1_files <- function(folder_path, fnc = "read_csv", ...) {
}

# Do not attempt to read in XML files
files_no_meta <- files[tools::file_ext(files) != "xml"]
files_no_meta <- files[tools::file_ext(files) %in% c("xml", "log") == FALSE]

# Make an empty list
data_list <- list()
Expand All @@ -56,7 +56,7 @@ read_d1_files <- function(folder_path, fnc = "read_csv", ...) {
sub_name <- basename(single_file)

# Use user-provided function
sub_df <- eval(parse(text = paste0(fnc, "('", single_file, "')")))
sub_df <- eval(parse(text = paste0(fnc, '("', normalizePath(single_file, winslash = '/'), '", ...)')))

# Add to list
data_list[[sub_name]] <- sub_df }
Expand Down

0 comments on commit c0f8a63

Please sign in to comment.