[R] Same function name

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon Jun 21 17:25:04 CEST 2010


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



More information about the R-help mailing list