lme4 和 nlme 包之间的干扰
我有这个脚本:
mod<-lmList(log(indwgt)~log(lngtclass)| sex, data=mbsp)
两周前就有效了。今天我感觉
Error in eval(expr, envir, enclos) : object 'indwgt' not found
这是由于lme4和nlme之间的干扰造成的,但我不知道如何删除nlme。如果有任何帮助,我尝试了这个:
getAnywhere(lmList)
2 differing objects matching ‘lmList’ were found
in the following places
package:lme4
namespace:lme4
namespace:nlme
但这对我来说毫无意义,除了增强我对两个包之间的干扰的感觉之外。有什么想法吗?我已经退出 R,重新开始,加载包,更新包,我能想到的一切。删除它们基本上不起作用。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确实,
lme4
和nlme
包中有两个(略有不同)版本的lmList
。如果您已加载两者,并且想要确保使用lmList
的nlme
版本,请使用nlme::lmList
。 或者通过detach("package:lme4")
卸载lme4
包。反之亦然,显然,如果您想使用lme4
版本 (lme4::lmList
,detach("package:nlme")
。< strong>但是,我实际上不明白lmList
的错误版本如何导致您发布str(mbsp)< 的结果。 /code> 会有所帮助...
It is true that there are two (slightly different) versions of
lmList
in thelme4
andnlme
packages. If you have both loaded and you want to make sure you are using thenlme
version oflmList
, usenlme::lmList
. Or unload thelme4
package viadetach("package:lme4")
. Vice versa, obviously, if you want to use thelme4
version (lme4::lmList
,detach("package:nlme")
. However, I don't actually see how having the wrong version oflmList
could lead to the specific error you are getting. Posting the results ofstr(mbsp)
would help ...您的错误消息意味着
indwgt
不在mbsp
中。您是否有可能在过去两周内进行了一些更改,导致名称发生了微妙的变化?
Your error message means that
indwgt
is not inmbsp
.Is it possible that you've made some change in the last two weeks that resulted in a subtle name change?