Re: [R] packages masking other objects

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
Date: Tue 01 Mar 2005 - 18:26:57 EST

James Smith wrote:
> hello all,
>
> I am trying to use the function getCovariateFormula(nlme) in conjunction with the library lme4. When I load both packages I get the following message and the getCovariateFormula function no longer works:
>
> library(nlme)
> library(lme4)
>
> Attaching package 'lme4':
>
>
> The following object(s) are masked from package:nlme :
>
> contr.SAS getCovariateFormula getResponseFormula groupedData lmeControl

So you don't have the most recent version of lme4 which tells you instead:

 > library(nlme)
 > library(lme4)
Loading required package: Matrix
Loading required package: latticeExtra
Error in fun(...) : Package lme4 conflicts with package nlme.   To attach lme4 you must restart R without package nlme. Error: .onLoad failed in loadNamespace for 'lme4' Error in library(lme4) : package/namespace load failed for 'lme4'

So the answer is: Don't do that.

Uwe Ligges

> I have tried removing the package after using it, with:
> detach(package:lme4)
> library(nlme)
>
> but I still get an error message when I try to use getCovariateFormula. The line I use it in, and the error message is below:
>
> rownames(table)<-c((getCovariateFormula(model1)),(getCovariateFormula(model2)),(getCovariateFormula(model3)),(getCovariateFormula(model4)),(getCovariateFormula(model5)),(getCovariateFormula(model6)),(getCovariateFormula(modelnull)))
>
> Error in switch(mode(x), "NULL" = structure(NULL, class = "formula"), :
> invalid formula
>
> This line works fine when I run models with different structures that are not in the lme4 package.
> Does anyone have any suggestions about this ?
> Am I not removing the package completely ?
>
> Any suggestions would be greatly appreciated
> Thanks
> James Smith
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Mar 01 18:31:28 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:38 EST