You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using workflow packages {drake} and {targets}, the only way to be able to use lme4::lmer() is if the data is called df. If the data frame used has any other name, you get an error.
I reported this issue to the {targets} developer here ropensci/targets#160 and he suggested to check here.
Please see reproducible examples below.
library(drake)
library(lme4)
plan_OK <- drake_plan(
df = sleepstudy,
mod = lme4::lmer("Reaction ~ Days + (Days | Subject)", df))
plan_BAD <- drake_plan(
DF = sleepstudy,
mod = lme4::lmer("Reaction ~ Days + (Days | Subject)", DF))
make(plan_OK)
make(plan_BAD)
plan_OK works fine, but plan_BAD gives the following error:
Error: target mod failed.
diagnose(mod)$error$message:
use of NULL environment is defunct
diagnose(mod)$error$calls:
lme4::lFormula(formula = "Reaction ~ Days + (Days | Subject)",
data = DF, control = list("nloptwrap", TRUE, 1e-05, TRUE,
FALSE, list("ignore", "stop", "ignore", "stop", "stop",
"message+drop.cols", "warning", "stop"), list(list(
"warning", 0.002, NULL), list("message", 1e-04),
list("warning", 1e-06)), list()))
lme4:::checkFormulaData(formula, data, checkLHS = control$check.formula.LHS ==
"stop")
lme4:::allvarex(environment(formula))
base::vapply(vvec, varex, NA, env)
lme4:::FUN(X[[i]], ...)
base::exists(v, envir = env, inherits = FALSE)
The same happens in {targets}, a newer package similar in scope to {drake}:
If data is called df, it works, otherwise (as in the example above), fails with the error :
Error : 'data' not found, and some variables missing from formula environment .
Error: callr subprocess failed: 'data' not found, and some variables missing from formula environment .
The text was updated successfully, but these errors were encountered:
It is indeed solved in the development version! I looked around the closed issues but did not find anything obviously related. Sorry for not checking before. Thanks!
When using workflow packages {drake} and {targets}, the only way to be able to use lme4::lmer() is if the data is called
df
. If the data frame used has any other name, you get an error.I reported this issue to the {targets} developer here ropensci/targets#160 and he suggested to check here.
Please see reproducible examples below.
plan_OK
works fine, butplan_BAD
gives the following error:The same happens in {targets}, a newer package similar in scope to {drake}:
If data is called df, it works, otherwise (as in the example above), fails with the error :
The text was updated successfully, but these errors were encountered: