Skip to content

Commit

Permalink
bug fix: keep factor rows with completely missing values
Browse files Browse the repository at this point in the history
  • Loading branch information
fb-elong committed Jul 12, 2024
1 parent 1c102e1 commit bfaee2d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/collect_n_subject.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down

0 comments on commit bfaee2d

Please sign in to comment.