简体   繁体   中英

roxygen2/ how to have only one help page for S4 generic and its methods?

Despite of experimenting with various stackoverflow answers on the topic and reading support documentation: http://r-pkgs.had.co.nz/man.html

I still haven't been able to create a package help page that would contain an S4 generic function and all of its methods as one and only one help page.

#' generic function for plotting classical multidimensional scaling
#' @param object (ReportClass or RunClass)
#' @rdname plotCMDS
#' @export

setGeneric("plotCMDS", function(object) {
standardGeneric("plotCMDS")})

#' @rdname plotCMDS
#' @export
setMethod("plotCMDS", signature(object = "ReportClass"), function(object) {
object@cdms})

#' @rdname plotCMDS
#' @export
setMethod("plotCMDS", signature(object = "RunClass"), function(object) {
listcmds <- lapply(object@reports, function(x) slot(x, "cmds"))
listcmds <- lapply(listcmds, `[[`, 1)
do.call(gridExtra::grid.arrange,  listcmds)})

This still shows in RStudio as two separate help pages both having the same content: 在此处输入图片说明

I would like to have only one help page:"plotCMDS generic function for plotting classical multidimensional scaling" including both the generic and its two methods.

My mistake. The help pages were correcty rendered in the pdf file as specified above. It was just that pdf file and RStudio GUI rendered the help pages differently.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM