diff --git a/DESCRIPTION b/DESCRIPTION index e7154b4ec..7dd5e80f0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -56,7 +56,8 @@ Imports: MASS, ordinal, nnet, - mclogit + mclogit, + reformulas, Suggests: ggrepel, ggfortify, diff --git a/NEWS.md b/NEWS.md index adca22ad8..6ca8b6572 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,7 +9,7 @@ If you read this from a place other than = v1.1-38. ## Bug fixes diff --git a/R/divergence_minimizers.R b/R/divergence_minimizers.R index fdd3eae13..5f4bf6a2c 100644 --- a/R/divergence_minimizers.R +++ b/R/divergence_minimizers.R @@ -52,7 +52,7 @@ divmin <- function( sdivmin <- fit_glmer_callback if (getOption("projpred.PQL", FALSE)) { # Split up the formula into a fixed and a random part (note: we could also - # use lme4::nobars() and lme4::findbars() here): + # use reformulas::nobars() and reformulas::findbars() here): formula_random <- split_formula_random_gamm4(formula) projpred_formulas_no_random <- validate_response_formula( formula_random$formula @@ -1342,11 +1342,11 @@ empty_intersection <- function(x, el_nm = "new") { # "GPL (>=2)" (see ). mkNewReTrms_man <- function(re.form, newdata, xlevels, re, D = NULL) { stopifnot(!is.null(newdata)) - tt <- terms(lme4::subbars(re.form)) + tt <- terms(reformulas::subbars(re.form)) rfd <- suppressWarnings( model.frame(tt, newdata, na.action = na.pass, xlev = xlevels) ) - ReTrms <- lme4::mkReTrms(lme4::findbars(re.form[[2]]), rfd) + ReTrms <- reformulas::mkReTrms(reformulas::findbars(re.form[[2]]), rfd) ns.re <- names(re) nRnms <- names(Rcnms <- ReTrms$cnms) if (!all(nRnms %in% ns.re)) { diff --git a/tests/testthat/test_refmodel.R b/tests/testthat/test_refmodel.R index e75e58825..6a87083b0 100644 --- a/tests/testthat/test_refmodel.R +++ b/tests/testthat/test_refmodel.R @@ -260,20 +260,17 @@ test_that(paste( # Without `ynew`: expect_warning( - predref_resp <- withCallingHandlers( - predict(refmods[[tstsetup]], dat, - weightsnew = wobs_crr, - offsetnew = offs_crr, - type = "response"), + withCallingHandlers( + predref_resp <- predict(refmods[[tstsetup]], dat, weightsnew = wobs_crr, + offsetnew = offs_crr, type = "response"), warning = function(w) { - if (grepl("nobars.*reformulas", conditionMessage(w))) { + if (grepl("(nobars|subbars|findbars|mkReTrms).*reformulas", conditionMessage(w))) { invokeRestart("muffleWarning") } } ), - get_warn_wrhs_orhs(tstsetup, - weightsnew = wobs_crr, - offsetnew = offs_crr), + get_warn_wrhs_orhs(tstsetup, weightsnew = wobs_crr, + offsetnew = offs_crr), info = tstsetup )