本文介绍了lme4和nlme软件包之间的干扰的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个脚本:

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

我觉得这是由于lme4和nlme之间的干扰所致,但是我不知道如何删除nlme.如果有帮助,我可以尝试以下方法:

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

但这对我来说没有任何意义,除了增强我对两个软件包之间的相互干扰的感觉.有任何想法吗?我退出了R,重新开始,加载程序包,更新程序包,我能想到的一切.删除它们基本上是行不通的.

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.

推荐答案

的确,在lme4nlme程序包中有两个(略有不同)的lmList版本.如果都已加载并且要确保使用的是lmListnlme版本,请使用nlme::lmList. Or 通过detach("package:lme4")卸载lme4程序包.反之亦然,显然,如果要使用lme4版本(lme4::lmListdetach("package:nlme").但是,我实际上看不到使用错误版本的lmList可能导致到您遇到的特定错误.发布str(mbsp)的结果会有所帮助...

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 ...

这篇关于lme4和nlme软件包之间的干扰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 17:37