I've read the Roxygen2 PDF and this site, and I'm lost on the difference between @method @S3method @export and how to use these to properly document S3 methods. I worked up the follow example for discussion:
- How would I properly document these?
- How do I emulate documentation of ?print and other generic functions that show the use cases for all class-specific implimentations (i.e. the way ?print shows usage for 'factor', 'table','function')
- From the wiki page: "All exported methods need the @S3method tag. It has the same format as @method. This exports the method, not the function - i.e. generic(myobject) will work, but generic.mymethod(myobject) will not."
I can't interpret this. This seems to say that function/method calls won't work properly if the tags are improperly specified? What specifically will break?
MyHappyFunction = function( x , ... )
{
UseMethod( "MyHappyFunction" )
}
MyHappyFunction.lm = function( x , ... )
{
# do some magic
}