In my toy package, I have defined %+%
operator as an alias to paste0()
. Trying to reduce interference with other packages, I realized it the follow
To export S3 methods, your NAMESPACE
file needs to (in your case) contain the following declarations:
export(`%+%`)
S3method(`%+%`, default)
S3method(`%+%`, character)
S3method(`%+%`, numeric)
That is, export the %+%
generic, and declare S3 methods for the methods.
Better yet, instead of manually editing the NAMESPACE
file use ‘roxygen2’, which generates the correct declarations for you based on the @export documentation tag.