Re: [R] Same function name

From: Barry Rowlingson <b.rowlingson_at_lancaster.ac.uk>
Date: Mon, 21 Jun 2010 16:25:04 +0100

On Mon, Jun 21, 2010 at 2:29 PM, Filoche <pmassicotte_at_hotmail.com> wrote:
>
> Hi everyone.
>
> I want to use 2 different functions (in 2 packages) that have same name. for
> instance, if I call the function, it will use the one in the last called
> package.  Is there a way to specify the package to use for a function?
>
> Something like
>
> Package1:myfunction(...)
> Package2:myfunction(xxx)
>
> With regards,
> Phil

 You just needed a little colonic irrigation:

 library(splancs)
 splancs::khat(...)

 might be hard to see on your screen, but it needs two colons between package and function.

Barry



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. Received on Mon 21 Jun 2010 - 15:50:15 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 21 Jun 2010 - 16:20:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive