From bfaee2d29204bc27e8638f87941ab960946675ea Mon Sep 17 00:00:00 2001 From: Yilong Zhang Date: Fri, 12 Jul 2024 05:13:38 +0000 Subject: [PATCH 1/2] bug fix: keep factor rows with completely missing values --- R/collect_n_subject.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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"]) From 7efaf55296f1e91b81d90b3336772cabe5614b44 Mon Sep 17 00:00:00 2001 From: fb-elong Date: Fri, 12 Jul 2024 05:17:11 +0000 Subject: [PATCH 2/2] Style code (GHA) --- R/collect_n_subject.R | 1 - 1 file changed, 1 deletion(-) diff --git a/R/collect_n_subject.R b/R/collect_n_subject.R index c109f17..4975c87 100644 --- a/R/collect_n_subject.R +++ b/R/collect_n_subject.R @@ -272,7 +272,6 @@ collect_n_subject <- function(meta, # standardize categorical variables if (any(c("factor", "character") %in% class_var)) { - if (any(c("character") %in% class_var)) { var <- factor(var, exclude = NULL) }