Skip to content

Commit

Permalink
fctr bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dswatson committed Jan 21, 2024
1 parent 1fe4400 commit 76f19c1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ prep_x <- function(x) {
'To override this behavior, explicitly code these variables as factors.')
x[, to_numeric] <- lapply(x[, to_numeric, drop = FALSE], as.numeric)
}
to_factor <- !to_numeric
to_factor <- sapply(seq_len(ncol(x)), function(j) {
idx_integer[j] & length(unique(x[[j]])) < 6
})
if (any(to_factor)) {
warning('Recoding integers with fewer than 6 unique values as ordered factors. ',
'To override this behavior, explicitly code these variables as numeric.')
Expand Down Expand Up @@ -95,7 +97,7 @@ prep_x <- function(x) {
prep_evi <- function(params, evidence) {

# To avoid data.table check issues
variable <- relation <- N <- n <- family <- NULL
variable <- relation <- N <- n <- family <- wt <- NULL

# Prep
setDT(evidence)
Expand Down

0 comments on commit 76f19c1

Please sign in to comment.