R S4 roxygen2 documentation

巧了我就是萌 提交于 2019-12-11 02:04:28

问题


I'm using roxygen2 for documentation in S4 and for some reason the usage section is not showing up. I made a simple example to show my confusion:

#' Title
#'
#' @param x Temp
#'  
#' @return Nothing of interest.
#' 
#' @export 
#' @docType methods
#' @rdname A-methods
setGeneric("A", function(x, ...){
  cat("test\n")
  standardGeneric("A")
})

#' @rdname A-methods
#' @aliases A,ANY,ANY-method
setMethod("A", "ANY", function(x, ...){
  cat(class(x))
})

#END#

回答1:


IMHO that is a common problem. You could try to use the s4 branch of roxygen. (For my small packages it works well.). To install the s4 branch from github:

library("devtools")
install_github("roxygen", "klutometis", ref="s4")


来源:https://stackoverflow.com/questions/18901589/r-s4-roxygen2-documentation

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