This commit is contained in:
Andreas Gammelgaard Damsbo 2024-11-21 14:22:36 +01:00
commit ae1c120cd8
No known key found for this signature in database
4 changed files with 30 additions and 16 deletions

View file

@ -50,7 +50,7 @@ file_extension <- function(filenames) {
#' @examples
#' read_input("https://raw.githubusercontent.com/agdamsbo/cognitive.index.lookup/main/data/sample.csv")
read_input <- function(file, consider.na = c("NA", '""', "")) {
ext <- tools::file_ext(file)
ext <- tolower(tools::file_ext(file))
tryCatch(
{
@ -66,7 +66,7 @@ read_input <- function(file, consider.na = c("NA", '""', "")) {
df <- readr::read_rds(file = file)
}else {
stop("Input file format has to be on of:
'.csv', '.xls', '.xlsx', '.dta', '.rds' or '.ods'")
'.csv', '.xls', '.xlsx', '.dta', '.ods' or '.rds'")
}
},
error = function(e) {