diff --git a/R/collect_n_subject.R b/R/collect_n_subject.R index 6e94893..c109f17 100644 --- a/R/collect_n_subject.R +++ b/R/collect_n_subject.R @@ -272,7 +272,10 @@ collect_n_subject <- function(meta, # standardize categorical variables if (any(c("factor", "character") %in% class_var)) { - var <- factor(var, exclude = NULL) + + if (any(c("character") %in% class_var)) { + var <- factor(var, exclude = NULL) + } if (all(is.na(var))) { levels(var) <- c(levels(var), title["missing"])