Skip to content

Commit

Permalink
Merge pull request #185 from Merck/bug_fix_max_null
Browse files Browse the repository at this point in the history
fix bug about warning come from max(NULL)
  • Loading branch information
nanxstats committed Mar 11, 2024
2 parents 3690a8d + b3d7f02 commit 9d02bd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/prepare_ae_specific.R
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ prepare_ae_specific <- function(meta,
par_n[[par_var]] <- par_n$name
par_n <- merge(u_soc, par_n, all.y = TRUE)
par_n$order <- 1e3 * as.numeric(factor(par_n[[par_soc]])) + seq_len(nrow(par_n))
par_n$order[is.na(par_n$order)] <- max(soc_n$order) + 1
par_n$order[is.na(par_n$order)] <- (if (!all(is.na(soc_n$order))) max(soc_n$order, na.rm = TRUE) else -Inf) + 1
par_n$name <- to_sentence(par_n$name)
} else {
par_n <- NULL
Expand Down

0 comments on commit 9d02bd4

Please sign in to comment.