Two functions with the same name in R

Possible duplicate:
Masked Functions in R
R: Masked Functions
function naming .

If I have two packages: A and B. Say, in there is a function called funfun , and in B there is a function called funfun . When I load A and B, how can I use the first funfun ?

 require(A) require(B) 

If I want to use funfun in A, how do I write this?

+7
source share
1 answer

You can explicitly refer to a combination of packages and functions as follows:

 A::funfun B::funfun 

In unusual circumstances, you may need to reference functions that are not exported in the namespace, in which case you need to use:

 A:::funfun B:::funfun 

(But that would be unusual, and since non-exported functions are not part of the package API, these functions may change without warning in future releases of the package.)

+10
source

All Articles