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

Juan Carlos Borrás jcborras at gmail.com
Tue Jun 28 15:38:20 CEST 2011


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...

Thanks in advance
jcb!



More information about the R-help mailing list