Skip to content

S4 signature for trailing ANY is not created #460

@wahani

Description

@wahani

Hi, I have the following problem while documenting a S4-generic and its methods:

When I define a method where the trailing argument has type "ANY" an entry in the documentation is only created for the signature "numeric" instead of numeric,ANY in the following example:

#' new generic
#'
#' @rdname myGeneric
#' @export
setGeneric("myGeneric", function(x, y) standardGeneric("myGeneric"))

#' @rdname myGeneric
#' @export
setMethod("myGeneric", c("numeric", "ANY"), function(x, y) x)

This results in a warning from R CMD check because the numeric,ANY method documentation entry is missing. I suspect that this happens because methods("myGeneric") will report that there is only a method for signature "numeric" and hence roxygen will only create a doc entry for this signature. This is only an issue when the last argument is of type "ANY" - a different order will work - since methods will report the correct signature.

Don't know if this is solvable within roxygen2. My attempts to bypass the issue by creating the doc entry manually have failed so far. I am using roxygen2 version 5.0.1 and R3.2.2 on Ubuntu 14.10

Thanks,
-s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions