Skip to content

@hadley hadley released this Dec 6, 2013 · 1034 commits to master since this release

Roxygen2 now fully supports S4 and RC (reference classes) - you should no
longer need to manually add @alias or @usage tags for S4 classes, methods
and generics, or for RC classes.

  • The default usage definitions are much better, generating the correct
    usage for data sets (#122), S3 methods (without additional @method tag),
    S4 generics, S4 methods, and for replacement (#119) and infix functions.
    Backslashes in function arguments in are correctly escaped. Usage statements
    also use a more sophisticated line wrapping algorithm so that they should
    cause fewer problems with the R CMD check line limit. (#89, #125).
  • S4 classes, S4 methods, and RC classes are given better default topics,
    and the file names corresponding to those topics are shorter.
  • S4 methods will automatically inherit parameter documentation from their
  • @slot name description allows you to document the slots of a S4 class.

S3 support has also been improved: roxygen2 now figures out whether a function
is a S3 method or generic. (In the rare cases it does so incorrectly, use
@method to manually describe the generic and class associated with a method).
This means you can remove existing uses of @method, and can replace
@S3method with @export.

Roxygen now has support for package specific options through the Roxygen
field in the DESCRIPTION. The value of the field should be R code that
results in a list. Currently only wrap and roclet values are supported:

  • Turn off Rd re-wrapping with adding Roxygen: list(wrap = FALSE)
  • Change the default roclets by specifying
    Roxygen: list(roclets = c("collate", "rd"))

Roxygen 3.0 also includes a number of minor fixes and improvements:

  • Infix functions are now escaped correctly in the NAMESPACE. (Thanks to
    @crowding, #111)
  • roxygenise() now works more like devtools::document() and only ever works
    in the current directory. The arguments roxygen.dir, overwrite,
    copy.package and have been deprecated due to potential
    data loss problems.
  • The collate roclet is no longer a roclet: it processes R files using custom
    code (only statically, not dynamically) and is designed to be executed before
    the code is sourced. Run update_collate() to update the Collate directive
    based on @include tags - if there are none present, a collate directive
    will not be generated.
  • @useDynLib now works with more possible specifications - if you include a
    comma in the tag value, the output will be passed as is. This means that
    @useDynLib mypackage, .registration = TRUE will now generate
    useDynLib(mypackage, .registration = TRUE) in the NAMESPACE. (#124)
  • inst directory not created by default (#56).
  • Explicitly depend on utils and methods packages to make roxygen
    compatible with Rscript (#72). Import digest package instead of
    depending on it.
  • Always use C locale when sorting NAMESPACE file or tags in .Rd files.
    This ensures a consistent ordering across systems (#127).
  • Templates with extension .r are supported on case-sensitive file systems
    (#115). Template variables now actually work (#160, thanks to @bronaugh).
  • Suppress default aliases, format and usage with @aliases NULL,
    @format NULL and @usage NULL.
Assets 2
You can’t perform that action at this time.