I am creating a R-package and I am at the step where I BUILD
the package.
I have read the Writing R Extensions documentation about NAMESPACE (more specifically the sections 1.5.1 and 1.5.2 on import, export and on registering S3method).
I am worrying about this step because when I CHECK
my package I got this warning:
Found the following apparent S3 methods exported but not registered: print.myClass print.myOtherClass summary.myClass summary.myOtherClass See section 'Registering S3 methods' in the 'Writing R Extensions' manual.
Any help in deciphering what are the consequences of not registering a S3method and about the NAMESPACE file in general would make my day.
Thanks for your help.
When there are, two functions of some name available in two different libraries, identifying which function to use is difficult. Namespace functions are used for overcoming this problem where it provides additional information to differentiate between the same function names present in different libraries in R.
The NAMESPACE file specifies the functions in the package that are exported to the user, and functions or packages that are imported by the package. Exported functions are functions from our package that are accessible by the user, and imported functions are functions from other packages used by our package.
I would bet 10:1 that you wrote something like
export(print.myClass)
in the namespace. Instead, you need to write
S3method(print, myClass)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With