How to document a method in R using Roxygen2 when the class and generic live in another package?

59 Views Asked by At

How does one document a method for a class defined in another package?

For example, I've written a method for the QDNAseqSignals class defined in the QDNAseq. I want to document this method using roxygen2.

Section A (Code in my new package):

#' A cool new plot
#'
#' @description
#' This new plot is great!
#'
#' @importClassesFrom QDNAseq QDNAseqReadCounts QDNAseqCopyNumbers
#' @export anewplot
setMethod("anewplot", signature(x="QDNAseqSignals", y="missing"),
          function (x, y, main=NULL, includeReadCounts=TRUE,...){}

Section B (Class in the QDNAseq package):

setClass('QDNAseqSignals',
    contains  = 'eSet',
    prototype = prototype(new('VersionedBiobase',
    versions  = c(classVersion('eSet'), QDNAseq=packageVersion('QDNAseq'))))
)

I am unable to get the code in section A to generate documentation properly when calling devtools::document. A plot-QDNAseqSignals-missing-method.Rd file is generated rather than the expected plot.Rd file.

I've tried using other export tags like: @exportMethod.

0

There are 0 best solutions below