R/reformulas_imports.R

Defines functions reOnly mkWarnFun

Documented in reOnly

## transient patches for moving formula manipulation machinery to lme4 without breaking downstream packages

mkWarnFun <- function(FUN) {
  fn <- function(...) {
    msg <- sprintf("the %s function has moved to the reformulas package. Please update your imports, or ask an upstream package maintainer to do so.", sQuote(FUN))
    rlang::warn(msg, .frequency = "once", .frequency_id = FUN)
    reformulas_fun <- getExportedValue("reformulas", FUN)
    reformulas_fun(...)
  }
  assign(FUN, fn, envir = parent.frame())
}

for (f in c("findbars","subbars", "nobars",
            "mkReTrms", "expandDoubleVerts", "isNested")) {
  mkWarnFun(f)
}

## handle reOnly separately, it needs to be wrapped to return a formula properly
## reformulas 0.4.5 will fix this (can then move back to the deprecation block above)
reOnly <- function(...) {
  res <- lme4_reOnly(...)
}

Try the lme4 package in your browser

Any scripts or data that you put into this service are public.

lme4 documentation built on March 6, 2026, 1:07 a.m.