Documenting generic S3 methods in R so that user can see documentation?

走远了吗. 提交于 2020-06-29 03:35:17

问题


I am extending the print() function by a method print.dmdSchemeSet(). This functions has additional arguments which I obviously have documented in the source files using roxygen2:

#' Generic print function for \code{dmdSchemeSet}
#'
#' @param x object of type \code{dmdSchemeSet}
#' @param ... additional arguments - not used here
#' @param printAttr default \code{TRUE} - attributes are printed
#' @param printExtAttr default \code{FALSE} - additional attributes are not printed (e.g. \code{class})
#' @param printData default \code{TRUE} - data is printed
#' @param .prefix mainly for internal use - prefix for all printed lines
#'
#' @return invisibly x
#' @export
#'
print.dmdSchemeSet <- function(x, ..., printAttr = TRUE, printExtAttr = FALSE, printData = TRUE, .prefix = ""){
...
}

Now the function is only exported as a generic function, which is fine, and it works.

But how can the user view the documentation for these functions?

Can I make the documentations in such a way, that it can be found in an intuitive way by the user?

来源:https://stackoverflow.com/questions/56630954/documenting-generic-s3-methods-in-r-so-that-user-can-see-documentation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!