[R] A masked function is a masked function by any other name

Duncan Murdoch murdoch.duncan at gmail.com
Tue Jun 28 15:42:10 CEST 2011


On 28/06/2011 9:38 AM, Juan Carlos Borrás wrote:
> Dear all,
> It looks like I do not grasp the concept of masked functions enough as
> to solve this trivial problem.
> The code that replicates the problem (a source code tree that realizes
> a R package actually) is under github so one can call it clone it
> easily from the command line (though more experienced users will spot
> the problem by browsing through the package code):
> git clone http://jcborras@github.com/jcborras/rseedpkg.git
>
> rseedpkg builds and installs with the usual sequence:
> R CMD build rseedpkg
> R CMD INSTALL rseedpkg_0.01-1.tar.gz
>
> Last but not least one can test it from the command line:
> Rscript --verbose --default-packages=testthat,log4r -e
> "test_package('rseedpkg')"
>
> The thing is that if one changes the call log4r:::debug() to plain
> debug() in R/f1.r and R/f2.r then one ends up calling base:::debug()
> and not log4r:::debug() even though the former should be masked by the
> later as log4r is a package dependency of my dummy rseedpkg. And
> that's something that I cannot understand...

If you are using ::: (three colons), then you may be looking into the 
unexported functions in log4r.  The only normal way to see unexported 
functions is to use three colons.

Duncan Murdoch



More information about the R-help mailing list