Начиная с roxygen2> 3.0.0, вам нужно только @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
}
Но так как вы на самом деле не документируете методы, следующее
достаточно:
#' 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
}