kollerma / robustlmm

This is an R-package for fitting linear mixed effects models in a robust manner. The method is based on the robustification of the scoring equations and an application of the Design Adaptive Scale approach.
28 stars 9 forks source link

hidden namespace issue in .rlmerInit #30

Open nlichti opened 5 months ago

nlichti commented 5 months ago

Hi. I am calling robustlmm::rlmer inside a function, but it fails with "... could not find function 'lmer'," if lme4 has not already been loaded by library or require.

The error is caused by the line linit <- eval(lcall2, pf) in .rlmerInit. Changing the previous line,

lcall2[[1]] <- as.name("lmer")

to

lcall2[[1]] <- substitute(lme4::lmer)

seems to fix it (as.name doesn't work with the colons).