tag-export: Namespace: tags for exporting objects

Description Details Tag Usage

Description

Generally, you will only need to use a bare @export - this will inspect the documented object and automatically figure out the correct export (which varies based on whether it's a function, s3 method, s4 class, s4 generic/method).

Details

The convention in roxygen3 is that exporting a generic automatically exports all associated methods. This happens automatically for S4 with the exportMethod directive, but needs considerable work for S3. For details, see roxgyen_s3.

It's not recommend practice to use @exportPattern (instead it's better to individually label the functions to be exported), but this may be useful for legacy packages.

@S3method exists largely for compatibility with roxygen2. Roxygen3 now automatically determines if an object is an S3 method, and so only @export is necessary.

Tag Usage

1
2
3
4
5
#' @exportClass class1 class2
#' @exportMethods generic1 generic2
#' @exportPattern pattern
#' @export
#'  @export function name

hadley/roxygen3 documentation built on May 17, 2019, 12:16 p.m.