As of roxygen2 >3.0.0, you only need @export
:
#' A description of MyHappyFunction
#'
#' A details of MyHappyFunction
#'
#' @title MyHappyFunction: The my happy function
#' @param x numeric number
#' @param ... other arguments
#' @examples
#' a <- 1
#' class(a) <- "lm"
#' MyHappyFunction(a)
#' @export
MyHappyFunction <- function(x, ...){
UseMethod("MyHappyFunction")
}
#' @rdname MyHappyFunction
#' @export
MyHappyFunction.lm = function(x, ...) {
# do some magic
}
#' @rdname MyHappyFunction
#' @export
MyHappyFunction.default = function(x, ...) {
# do some magic
}
But since you're not actually documenting the methods, the following is
sufficient:
#' A description of MyHappyFunction
#'
#' A details of MyHappyFunction
#'
#' @title MyHappyFunction: The my happy function
#' @param x numeric number
#' @param ... other arguments
#' @examples
#' a <- 1
#' class(a) <- "lm"
#' MyHappyFunction(a)
#' @export
MyHappyFunction <- function(x, ...){
UseMethod("MyHappyFunction")
}
#' @export
MyHappyFunction.lm = function(x, ...) {
# do some magic
}
#' @export
MyHappyFunction.default = function(x, ...) {
# do some magic
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…