Michael Kubovy
2012-Mar-08 01:53 UTC
[R] Packages 'effects' loads 'name' which conflicts with 'lme4'
Hi, I would like to use the effect() function (actually a slightly modified version of it) on the output of the lmer() function in the lme4 package. But the effects package requires the nlme pacvkage, which is incompatible with lme4. Workaround? ______________________________________________ Professor Michael Kubovy University of Virginia Department of Psychology for mail add: for FedEx or UPS add: P.O.Box 400400 Gilmer Hall, Room 102 Charlottesville, VA 22904-4400 485 McCormick Road USA Charlottesville, VA 22903 room phone Office: B011 +1-434-982-4729 Lab: B019 +1-434-982-4751 WWW: http://www.people.virginia.edu/~mk9y/ [[alternative HTML version deleted]]
John Fox
2012-Mar-08 02:19 UTC
[R] Packages 'effects' loads 'name' which conflicts with 'lme4'
Dear Michael, effect() works with lmer(). Just load lme4 after the effect package. See the penultimate example in ?effect. I hope this helps, John ------------------------------------------------ John Fox Sen. William McMaster Prof. of Social Statistics Department of Sociology McMaster University Hamilton, Ontario, Canada http://socserv.mcmaster.ca/jfox/ On Wed, 7 Mar 2012 20:53:20 -0500 Michael Kubovy <kubovy at virginia.edu> wrote:> Hi, > > I would like to use the effect() function (actually a slightly modified version of it) on the output of the lmer() function in the lme4 package. But the effects package requires the nlme pacvkage, which is incompatible with lme4. Workaround? > ______________________________________________ > Professor Michael Kubovy > University of Virginia > Department of Psychology > for mail add: for FedEx or UPS add: > P.O.Box 400400 Gilmer Hall, Room 102 > Charlottesville, VA 22904-4400 485 McCormick Road > USA Charlottesville, VA 22903 > room phone > Office: B011 +1-434-982-4729 > Lab: B019 +1-434-982-4751 > WWW: http://www.people.virginia.edu/~mk9y/ > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
John Fox
2012-Mar-08 15:50 UTC
[R] Packages 'effects' loads 'name' which conflicts with 'lme4' [corrected subject: Package 'effects' loads 'nlme' which conflicts with 'lme4']
Dear Spencer,> -----Original Message----- > From: Spencer Graves [mailto:spencer.graves at prodsyse.com] > Sent: March-08-12 10:29 AM > To: Michael Kubovy > Cc: John Fox; r-help > Subject: Re: [R] Packages 'effects' loads 'name' which conflicts with > 'lme4' [corrected subject: Package 'effects' loads 'nlme' which > conflicts with 'lme4'] > > Dear John, et al.: > > > What happens if lme4 is loaded before the effect package?Then some functions in it will be masked by nlme, which is loaded along with effects. Sandy Weisberg and I are discussing moving nlme from "Depends" to "Suggests" in the effects package Description file to avoid this potential problem. Although we'll have to check more carefully, I don't at this point see a reason not to do that.> > > Is this an issue of a user wanting to use two different packages > with potentially conflicting names? What are the standard > recommendations for handling issues like this? Just to test my > comprehension, I assume that the key is that users should routinely > watch for warnings of name conflicts and follow the advice of sect. > "1.6.1 Specifying imports and exports" of "Writing R Extensions" when > that occurs? (This is another reason for writing R packages and using > namespaces, so users can record appropriately what they want in > situations like this and not have to worry about name conflicts later?)The name conflicts are in lme4 and nlme, which share an author. I think that it's inevitable with 3000+ CRAN packages that there will be name conflicts, even if packages only export objects meant for the user. Best, John> > > Thanks, > Spencer > > > On 3/8/2012 4:19 AM, Michael Kubovy wrote: > > Dear John, > > > > Thanks for the quick response. It works perfectly. > > > > Michael > > > > On Mar 7, 2012, at 9:19 PM, John Fox wrote: > > > >> Dear Michael, > >> > >> effect() works with lmer(). Just load lme4 after the effect package. > See the penultimate example in ?effect. > >> > >> I hope this helps, > >> John > >> > >> ------------------------------------------------ > >> John Fox > >> Sen. William McMaster Prof. of Social Statistics Department of > >> Sociology McMaster University Hamilton, Ontario, Canada > >> http://socserv.mcmaster.ca/jfox/ > >> > >> On Wed, 7 Mar 2012 20:53:20 -0500 > >> Michael Kubovy<kubovy at virginia.edu> wrote: > >>> Hi, > >>> > >>> I would like to use the effect() function (actually a slightly > modified version of it) on the output of the lmer() function in the > lme4 package. But the effects package requires the nlme pacvkage, which > is incompatible with lme4. Workaround? > > ______________________________________________ > > Professor Michael Kubovy > > University of Virginia > > Department of Psychology > > for mail add: for FedEx orUPS add:> > P.O.Box 400400 Gilmer Hall, Room102> > Charlottesville, VA 22904-4400 485 McCormick Road > > USA Charlottesville, VA22903> > room phone > > Office: B011 +1-434-982-4729 > > Lab: B019 +1-434-982-4751 > > WWW: http://www.people.virginia.edu/~mk9y/ > > > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help at r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide > > http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > > > > -- > Spencer Graves, PE, PhD > President and Chief Technology Officer > Structure Inspection and Monitoring, Inc. > 751 Emerson Ct. > San Jos?, CA 95126 > ph: 408-655-4567 > web: www.structuremonitoring.com
Michael Kubovy
2012-Mar-09 01:45 UTC
[R] Packages 'effects' loads 'name' which conflicts with 'lme4' [corrected subject: Package 'effects' loads 'nlme' which conflicts with 'lme4']
Hi Spencer, In an Sweave script, which would take me too long to boil down to a reproducible example, lme4 was loaded before effects, and a calculation involving the effect() function failed. This was remedied by following John's advice and loading the two packages in the order he recommended at the beginning of the run. The problem went away. As far as I can tell, no such warning was issued, or at least none was noticed by me, because I'm caching many computations, which may hide warnings. MK On Mar 8, 2012, at 10:29 AM, Spencer Graves wrote:> Dear John, et al.: > > > What happens if lme4 is loaded before the effect package? > > > Is this an issue of a user wanting to use two different packages with potentially conflicting names? What are the standard recommendations for handling issues like this? Just to test my comprehension, I assume that the key is that users should routinely watch for warnings of name conflicts and follow the advice of sect. "1.6.1 Specifying imports and exports" of "Writing R Extensions" when that occurs? (This is another reason for writing R packages and using namespaces, so users can record appropriately what they want in situations like this and not have to worry about name conflicts later?) > > > Thanks, > Spencer > > > On 3/8/2012 4:19 AM, Michael Kubovy wrote: >> Dear John, >> >> Thanks for the quick response. It works perfectly. >> >> Michael >> >> On Mar 7, 2012, at 9:19 PM, John Fox wrote: >> >>> Dear Michael, >>> >>> effect() works with lmer(). Just load lme4 after the effect package. See the penultimate example in ?effect. >>> >>> I hope this helps, >>> John >>> >>> ------------------------------------------------ >>> John Fox >>> Sen. William McMaster Prof. of Social Statistics >>> Department of Sociology >>> McMaster University >>> Hamilton, Ontario, Canada >>> http://socserv.mcmaster.ca/jfox/ >>> >>> On Wed, 7 Mar 2012 20:53:20 -0500 >>> Michael Kubovy<kubovy@virginia.edu> wrote: >>>> Hi, >>>> >>>> I would like to use the effect() function (actually a slightly modified version of it) on the output of the lmer() function in the lme4 package. But the effects package requires the nlme pacvkage, which is incompatible with lme4. Workaround? >> ______________________________________________ >> Professor Michael Kubovy >> University of Virginia >> Department of Psychology >> for mail add: for FedEx or UPS add: >> P.O.Box 400400 Gilmer Hall, Room 102 >> Charlottesville, VA 22904-4400 485 McCormick Road >> USA Charlottesville, VA 22903 >> room phone >> Office: B011 +1-434-982-4729 >> Lab: B019 +1-434-982-4751 >> WWW: http://www.people.virginia.edu/~mk9y/ >> >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> > > > -- > Spencer Graves, PE, PhD > President and Chief Technology Officer > Structure Inspection and Monitoring, Inc. > 751 Emerson Ct. > San José, CA 95126 > ph: 408-655-4567 > web: www.structuremonitoring.com >______________________________________________ Professor Michael Kubovy University of Virginia Department of Psychology for mail add: for FedEx or UPS add: P.O.Box 400400 Gilmer Hall, Room 102 Charlottesville, VA 22904-4400 485 McCormick Road USA Charlottesville, VA 22903 room phone Office: B011 +1-434-982-4729 Lab: B019 +1-434-982-4751 WWW: http://www.people.virginia.edu/~mk9y/ [[alternative HTML version deleted]]