[Rd] S4 generic masking S3 generic when using namespace
Gad Abraham
gabraham at csse.unimelb.edu.au
Tue Mar 10 11:02:07 CET 2009
Hi,
I have two example packages, test1 and test2, where the only code in
them is:
setGeneric("predict", function(object, ...) standardGeneric("predict"))
(get them from http://www.cs.mu.oz.au/~gabraham/test1.tar and
http://www.cs.mu.oz.au/~gabraham/test2.tar)
The difference between them is that first does not have a namespace, and
loads fine. The second has a namespace but generates a warning:
> library(test2)
Attaching package: 'test2'
The following object(s) are masked from package:stats :
predict
Is this an intended behaviour? If I ignore this masking warning, do I
risk unintended consequences later down the track?
Thanks,
Gad
> sessionInfo()
R version 2.8.1 (2008-12-22)
i386-apple-darwin8.11.1
locale:
en_AU.UTF-8/en_AU.UTF-8/C/C/en_AU.UTF-8/en_AU.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] test2_0.1
--
Gad Abraham
MEng Student, Dept. CSSE and NICTA
The University of Melbourne
Parkville 3010, Victoria, Australia
email: gabraham at csse.unimelb.edu.au
web: http://www.csse.unimelb.edu.au/~gabraham
More information about the R-devel
mailing list