Skip to content

Commit

Permalink
Deal with another merModTest error
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-long committed Jul 29, 2024
1 parent 37869cf commit ec6ed5a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/johnson_neyman.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,11 @@ johnson_neyman <- function(model, pred, modx, vmat = NULL, alpha = 0.05,
coef(mod)
}
}

# lmerModTest and perhaps others do not give dataClasses in terms object
# so I need to both check for existence and check for data type
dataclass <- attr(terms(model), "dataClasses")[pred]
# Try to support logical predictors, maybe a precursor to factor predictors
if (attr(terms(model), "dataClasses")[pred] == "logical") {
if (!is.null(dataclass) && dataclass == "logical") {
pred_names <- paste0(pred, "TRUE")
} else {
pred_names <- pred
Expand Down

0 comments on commit ec6ed5a

Please sign in to comment.