Re: [R] identical function names from 2 packages

2011-05-20 Thread Jari Oksanen
Duncan Murdoch murdoch.duncan at gmail.com writes: On 18/05/2011 10:02 PM, Nick Matzke wrote: Hi, If I load 2 packages that have a function with the same name, how do I tell R to run one or the other? If you are using a package without a namespace, expect problems. Having the

Re: [R] identical function names from 2 packages

2011-05-20 Thread Rolf Turner
My understanding (which is pretty shaky when it comes to namespaces) is that if you have things set up correctly then namespaces will make sure that function calls within functions in the given package will be to be to functions in that package and not to their doppelgangers in other packages

Re: [R] identical function names from 2 packages

2011-05-20 Thread Janko Thyson
Hi, I encounter similar problems as well and posted a while ago about this. Namespaces are cool, but isn't it very much up to a package's position in the search path (which is quite arbitrary depending on the packages loaded) that determines which namespace dominates? That leaves it to the

Re: [R] identical function names from 2 packages

2011-05-20 Thread Barry Rowlingson
On Fri, May 20, 2011 at 9:16 AM, Janko Thyson janko.thyson.rst...@googlemail.com wrote: Yet, IMHO there will be more and more problems regarding this in the future as the number of contributed packages keeps growing. I personally would not mind at all to get used to typing 'thePackage::foo()'

Re: [R] identical function names from 2 packages

2011-05-20 Thread Janko Thyson
Thanks for the info. I think I've tried that a while ago, but IIRCC, the problem was always that R won't let me create on object that would pass as a full grown NAMESPACE object. foo - function(x) print(x) assignInNamespace(x=foo, value=foo, ns=testNS) Fehler in loadNamespace(name) : there

Re: [R] identical function names from 2 packages

2011-05-20 Thread Greg Snow
...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Rolf Turner Sent: Friday, May 20, 2011 1:29 AM To: Jari Oksanen Cc: r-h...@stat.math.ethz.ch Subject: Re: [R] identical function names from 2 packages

Re: [R] identical function names from 2 packages

2011-05-20 Thread Rolf Turner
On reflection, it seems to me that what we really need here is Prof. Ripley's mind_read() function that was foreshadowed some years ago (see fortune(mind_read)) so that R could determine just *which* lm() (for example) function the user has in mind when he or she types ``lm(...)'' at the

Re: [R] identical function names from 2 packages

2011-05-20 Thread baptiste auguie
I imagine mind_read() easy to implement with Robin Hankin's emulator package -- under some weak assumptions about the user; mind_write(), however, seems more involved and might require investing in new hardware. Best, baptiste On 21 May 2011 12:04, Rolf Turner rolf.tur...@xtra.co.nz wrote: On

Re: [R] identical function names from 2 packages

2011-05-19 Thread Duncan Murdoch
On 18/05/2011 10:02 PM, Nick Matzke wrote: Hi, If I load 2 packages that have a function with the same name, how do I tell R to run one or the other? (Instead of having R automatically use the first- or last-loaded one, whichever it is. (Which is it, by the way.)) Cheers! Nick It is the

Re: [R] identical function names from 2 packages

2011-05-18 Thread Scott Chamberlain
Is it not something like? package1::myfunction package2::myfunction On Wednesday, May 18, 2011 at 9:02 PM, Nick Matzke wrote: Hi, If I load 2 packages that have a function with the same name, how do I tell R to run one or the other? (Instead of having R automatically use the first- or

Re: [R] identical function names from 2 packages

2011-05-18 Thread Ista Zahn
Hi Nick, See ?:: Best, Ista On Wed, May 18, 2011 at 10:02 PM, Nick Matzke mat...@berkeley.edu wrote: Hi, If I load 2 packages that have a function with the same name, how do I tell R to run one or the other? (Instead of having R automatically use the first- or last-loaded one, whichever

Re: [R] identical function names from 2 packages

2011-05-18 Thread Nick Matzke
Thanks!! Nick On 5/18/11 7:06 PM, Ista Zahn wrote: Hi Nick, See ?:: Best, Ista On Wed, May 18, 2011 at 10:02 PM, Nick Matzkemat...@berkeley.edu wrote: Hi, If I load 2 packages that have a function with the same name, how do I tell R to run one or the other? (Instead of having R