Search code examples
rroxygen2

Roxygen documentation for existing generics


I wrote a show() method for the S4 class myclass which I had defined in my package. I generated documentation for class and method with roxygen2. Everything works nicely, except that I get the following warning in R CMD check results:

checking for missing documentation entries ... WARNING
Undocumented S4 methods: generic 'length' and siglist 'myclass'

How do I go about documenting show generic which I did not write myself?


Solution

  • In the end, using explicit @aliases and @docType tags solved the issue for me. My documentation block now looks like this:

    #' Show method for objects of class \code{myclass}.
    #'
    #' @docType methods
    #' @name show-myclass
    #' @rdname show-myclass
    #' @aliases show-myclass show,myclass-method
    #'
    #' @param x A \code{myclass} object.
    #'
    #' @export