Skip to content

Commit

Permalink
Merge pull request #165 from Merck/bug-empty-factor
Browse files Browse the repository at this point in the history
bug fix: keep factor rows with completely missing values
  • Loading branch information
fb-elong authored Jul 12, 2024
2 parents 1c102e1 + 7efaf55 commit 8d91831
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/collect_n_subject.R
Original file line number Diff line number Diff line change
@@ -272,7 +272,9 @@ 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"])

0 comments on commit 8d91831

Please sign in to comment.