Search code examples
rroxygen2

Omit aliases in roxygen2


I want to document multiple functions in single help page using roxygen2 but I want to have only a single alias to the help page i.e. General listed in the index. Is it possible?

An example:

#' General functions
#' @name General
NULL

#' @rdname Foo
foo <- function() NULL

#' @rdname Bar
bar <- function() NULL

How to omit foo and bar aliases from the package documentation index?

Real life example here would be single Arithmetic alias for documenting different functions (+, -, /, * etc.).


Solution

  • I found the answer by myself: you simply don't export those and make a function-independent documentation page:

    #' General functions
    #'
    #' @usage
    #' foo()
    #' bar()
    #'
    #' @name General
    NULL
    
    #' @export
    foo <- function() NULL
    
    #' @export
    bar <- function() NULL