Skip to content

Commit

Permalink
Fix styler issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mingstat committed Nov 26, 2024
1 parent 7002257 commit 64b7558
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@ create_data_list <- function(file_path, file_names, prefer_sas) {
#' @keywords internal
read_file_and_attach_metadata <- function(path) {
extension <- tools::file_ext(path)

if (toupper(extension) == "RDS") {
data <- readRDS(path)
} else if (toupper(extension) == "SAS7BDAT") {
data <- haven::read_sas(path)
} else {
stop("Not supported file type, only .rds or .sas7bdat files can be loaded.")
}

meta <- file.info(path, extra_cols = FALSE)
meta[["path"]] <- path
meta[["file_name"]] <- basename(path)
row.names(meta) <- NULL

attr(data, "meta") <- meta

return(data)
}

0 comments on commit 64b7558

Please sign in to comment.