mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2024-11-22 13:30:23 +01:00
simplify code to convert factors to character
This commit is contained in:
parent
568ae05879
commit
f7c1e01eff
@ -64,12 +64,7 @@ REDCap_split <- function(records, metadata) {
|
||||
)
|
||||
|
||||
# Make sure that no metadata columns are factors
|
||||
metadata_factors <- sapply(metadata, inherits, "factor")
|
||||
if(any(metadata_factors)) {
|
||||
|
||||
metadata[metadata_factors] <- lapply(metadata[metadata_factors], as.character)
|
||||
|
||||
}
|
||||
metadata <- rapply(metadata, as.character, classes = "factor", how = "replace")
|
||||
|
||||
# Find the fields and associated form
|
||||
fields <- metadata[
|
||||
|
Loading…
Reference in New Issue
Block a user