Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ranef function overwritten by loading ordinal package #48

Closed
dwarton opened this issue Mar 7, 2022 · 1 comment
Closed

ranef function overwritten by loading ordinal package #48

dwarton opened this issue Mar 7, 2022 · 1 comment

Comments

@dwarton
Copy link

dwarton commented Mar 7, 2022

library(lme4)
fm1 <- lmer(Reaction ~ Days + (Days | Subject), data=sleepstudy)
ranef(fm1)
library(ordinal)
ranef(fm1)

The first call to ranef works, the second returns an error

Error in UseMethod("ranef") : 
  no applicable method for 'ranef' applied to an object of class "c('lmerMod', 'merMod')"

The reason for the error is that generic ranef function, rather than being imported to the ordinal package from nlme, is defined inside the package (at line 29 of clmm.ranef.R). Can you please delete these lines and instead add to NAMESPACE importFrom(nlme, ranef) (which is currently actually at lines 42-43 of the file, but it has been commented out).

@runehaubo
Copy link
Owner

Thanks. Should be fixed in the next version (though fixing it was not as easy as you described it ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants