Hello all! R2.0.1, W2k. All packages updated. I?m heavily dependant on using mixed models. Up til?now I have used lme() from nlme as I have been told to. Together with estimable() from gmodels it works smooth. I also often run Rcmdr, mostly for quick graphics. After using Rcmdr, on reopening the R workspace all help libraries for Rcmdr (22 !) loads, among them nlme, but not Rcmdr itself. Why? Now I saw on the list yesterday, that lmer() from lme4 offers better coding possibilities for crossed random factors, it feels natural to switch from lme() to lmer() if estimable() still works on the objects. So I installed lme4, but got a conflict with the (auto)loaded 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' Several questions here: Why do all these packages autoload, and could I avoid this in some way? Why a conflict? Isn?t it possible to mask the conflicting parts of nlme when loading lme4? Why are the mixed models tools from the same author(s?) splitted between nlme and lme4? Are there any technical reasons not to include lmer() in nlme? Cheers /CG CG Pettersson, MSci, PhD Stud. Swedish University of Agricultural Sciences Dep. of Ecology and Crop Production. Box 7043 SE-750 07 Uppsala
CG Pettersson wrote:> Hello all! > > R2.0.1, W2k. All packages updated. > > I?m heavily dependant on using mixed models. Up til?now I have used > lme() from nlme as I have been told to. Together with estimable() from > gmodels it works smooth. I also often run Rcmdr, mostly for quick > graphics. > > After using Rcmdr, on reopening the R workspace all help libraries for > Rcmdr (22 !) loads, among them nlme, but not Rcmdr itself. Why? > > Now I saw on the list yesterday, that lmer() from lme4 offers better > coding possibilities for crossed random factors, it feels natural to > switch from lme() to lmer() if estimable() still works on the objects. > > So I installed lme4, but got a conflict with the (auto)loaded 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' > > Several questions here: > > Why do all these packages autoload, and could I avoid this in some > way? > Why a conflict? Isn?t it possible to mask the conflicting parts of > nlme when loading lme4?One reason for my recently introducing the name lmer for the revised lme function was eventually to remove the conflict of the lme4 package with the nlme package. In current versions of lme4 I still have an lme function that generates an S4 object of the S4 class "lme". Because of the conflict of functions of the same name producing different classes of objects I must have the nlme and lme4 packages conflict. Right now there are some models that can be fit by the S4-based lme and not be lmer. There are some "infelicities" in the underlying C code for lmer when dealing with non-nested vector-valued random effects. Once I track down and fix these infelicies I can remove the lme function from the lme4 package and remove the conflict with the nlme package.> Why are the mixed models tools from the same author(s?) splitted > between nlme and lme4? Are there any technical reasons not to include > lmer() in nlme?Once you have published a book you have committed yourself to a particular API for as long as the book remains in print. I can't easily change the way that the lme and related functions in the nlme package work because they are documented in our book. The functions in lme4 operate in a fundamentally different way, precisely because they are designed to handle crossed random effects in addition to nested random effects. The lme4 package is a work in progress. I am following Eric Raymond's Open Source dictum of 'release early and release often'. There will inevitably be inconveniences associated with using developmental code. I can guarantee that this is the last time that I will fundamentally redesign the computational methods and data structures used in fitting mixed-effects models. This is the fifth time I have done it from scratch and after this one I am quitting the business.
Dear CG, Doug Bates has already addressed the conflict between the nlme and lme4 packages. The Rcmdr package loads a number of other packages to use functions in them. I frankly don't recall why I need nlme, but something in it must be used somewhere in the Rcmdr. You could get rid of the dependency of the Rcmdr on nlme by editing the package DESCRIPTION file and recompiling the package. The fact that I can't remember why nlme is required suggests that removing it won't break much, so you'll probably still be able to do what you want. As far as I'm aware, you cannot restart the R Commander from a saved R workspace. You can, however, proceed as follows: Close the Commander window; close R and save the workspace; (presumably in a later session) restart R; load the Rcmdr package via library(Rcmdr). I hope this helps, John -------------------------------- John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox --------------------------------> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of CG Pettersson > Sent: Friday, January 28, 2005 5:15 AM > To: r-help at stat.math.ethz.ch > Subject: [R] Conflicts using Rcmdr, nlme and lme4 > > Hello all! > > R2.0.1, W2k. All packages updated. > > I?m heavily dependant on using mixed models. Up til?now I have used > lme() from nlme as I have been told to. Together with > estimable() from gmodels it works smooth. I also often run > Rcmdr, mostly for quick graphics. > > After using Rcmdr, on reopening the R workspace all help > libraries for Rcmdr (22 !) loads, among them nlme, but not > Rcmdr itself. Why? > > Now I saw on the list yesterday, that lmer() from lme4 offers > better coding possibilities for crossed random factors, it > feels natural to switch from lme() to lmer() if estimable() > still works on the objects. > > So I installed lme4, but got a conflict with the (auto)loaded 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' > > Several questions here: > > Why do all these packages autoload, and could I avoid this in > some way? > Why a conflict? Isn?t it possible to mask the conflicting > parts of nlme when loading lme4? > Why are the mixed models tools from the same author(s?) > splitted between nlme and lme4? Are there any technical > reasons not to include > lmer() in nlme? > > Cheers > /CG > > CG Pettersson, MSci, PhD Stud. > Swedish University of Agricultural Sciences Dep. of Ecology > and Crop Production. Box 7043 SE-750 07 Uppsala > > ______________________________________________ > R-help at 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
Dear CG, An addendum to my previous response: If you do decide to recompile the Rcmdr package to eliminate the dependency on nlme, as I suggested, you'll also have to edit the .onLoad() function in the package (which is in the file startup.R in the source package) to remove "nlme" from the vector of required packages. Regards, John -------------------------------- John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox --------------------------------> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of CG Pettersson > Sent: Friday, January 28, 2005 5:15 AM > To: r-help at stat.math.ethz.ch > Subject: [R] Conflicts using Rcmdr, nlme and lme4 > > Hello all! > > R2.0.1, W2k. All packages updated. > > I?m heavily dependant on using mixed models. Up til?now I have used > lme() from nlme as I have been told to. Together with > estimable() from gmodels it works smooth. I also often run > Rcmdr, mostly for quick graphics. > > After using Rcmdr, on reopening the R workspace all help > libraries for Rcmdr (22 !) loads, among them nlme, but not > Rcmdr itself. Why? > > Now I saw on the list yesterday, that lmer() from lme4 offers > better coding possibilities for crossed random factors, it > feels natural to switch from lme() to lmer() if estimable() > still works on the objects. > > So I installed lme4, but got a conflict with the (auto)loaded 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' > > Several questions here: > > Why do all these packages autoload, and could I avoid this in > some way? > Why a conflict? Isn?t it possible to mask the conflicting > parts of nlme when loading lme4? > Why are the mixed models tools from the same author(s?) > splitted between nlme and lme4? Are there any technical > reasons not to include > lmer() in nlme? > > Cheers > /CG > > CG Pettersson, MSci, PhD Stud. > Swedish University of Agricultural Sciences Dep. of Ecology > and Crop Production. Box 7043 SE-750 07 Uppsala > > ______________________________________________ > R-help at 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