Interference between lme4 and nlme packages

怎甘沉沦 提交于 2019-12-12 03:22:53

问题


I had this script:

mod<-lmList(log(indwgt)~log(lngtclass)| sex, data=mbsp) 

that worked two weeks ago. Today I get

Error in eval(expr, envir, enclos) : object 'indwgt' not found

I feel it is due to interferences between lme4 and nlme, but I don't know how to remove nlme. If it is of any help, I tried this:

getAnywhere(lmList)

2 differing objects matching ‘lmList’ were found
in the following places
  package:lme4
  namespace:lme4
  namespace:nlme

but it is meaningless to me, apart from strengthening my feeling of interference between both packages. Any ideas? I have quit R, started again, load packages, updated packages, everything I could think of. Removing them basically does not work.


回答1:


It is true that there are two (slightly different) versions of lmList in the lme4 and nlme packages. If you have both loaded and you want to make sure you are using the nlme version of lmList, use nlme::lmList. Or unload the lme4 package via detach("package:lme4"). Vice versa, obviously, if you want to use the lme4 version (lme4::lmList, detach("package:nlme"). However, I don't actually see how having the wrong version of lmList could lead to the specific error you are getting. Posting the results of str(mbsp) would help ...




回答2:


Your error message means that indwgt is not in mbsp.

Is it possible that you've made some change in the last two weeks that resulted in a subtle name change?



来源:https://stackoverflow.com/questions/8416696/interference-between-lme4-and-nlme-packages

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!