implemented specification of categorical variables (logicals are converted to factor)

This commit is contained in:
Andreas Gammelgaard Damsbo 2024-11-19 12:55:09 +01:00
commit f5965a2748
No known key found for this signature in database
4 changed files with 113 additions and 12 deletions

View file

@ -62,10 +62,12 @@ read_input <- function(file, consider.na = c("NA", '""', "")) {
} else if (ext == "dta") {
df <- haven::read_dta(file = file)
} else if (ext == "ods") {
df <- readODS::read_ods(file = file)
} else {
df <- readODS::read_ods(path = file)
} else if (ext == "rds") {
df <- readr::read_rds(file = file)
}else {
stop("Input file format has to be on of:
'.csv', '.xls', '.xlsx', '.dta' or '.ods'")
'.csv', '.xls', '.xlsx', '.dta', '.rds' or '.ods'")
}
},
error = function(e) {