roxygen2 7.2.0

  roxygen2, devtools

  Hadley Wickham

We’re tickled pink to announce the release of roxygen2 7.2.0. roxygen2 allows you to write specially formatted R comments that generate R documentation files (man/*.Rd) and the NAMESPACE file. roxygen2 is used by over 9,000 CRAN packages.

You can install it from CRAN with:

install.packages("roxygen2")

There are five big improvements in this release:

  • The NAMESPACE roclet now preserves all existing non-import directives during its first pass. This will generally eliminate the pair of "NAMESPACE has changed" messages and should reduce the chances that you end up with a sufficiently broken NAMESPACE that you can’t re-load and re-document your package.

  • @inheritParams now only inherits exact multi-parameter matches. For example take my_plot() below:

    #' @param width,height The dimensions in inches
    my_plot <- function(x, width, height) {
    
    }

    Previously, width and height were inherited individually, so this roxygen2 block:

    #' @inheritParams my_plot
    your_plot <- function(x, y, width, height) {
    
    } 

    Would be equivalent to:

    #' @param width The dimensions in inches
    #' @param height The dimensions in inches
    your_plot <- function(x, y, width, height) {
    
    } 

    Now, multi-parameter arguments will be inherited as a whole. This could potentially break your documentation if you (e.g.) only had one of width and height in your function. But we’ve only seen this problem a few places in the tidyverse, it was easily fixed, and inherited arguments are generally much improved.

  • We’ve done a thorough review of all warning messages to make them more informative and actionable. We’ve also fixed a number of bugs that led to invalid Rd files or pointed you to the wrong place.

    If you have a daily build of RStudio, warnings now include a clickable link that takes you directly to the problem. This technology is under active development across the IDE and the cli package and you can expect to see more of it in the future.

You can see a full list of changes in the release notes.

Acknowledgements

A big thanks to everyone who contributed to this release through their issues, pull requests, and discussions! @AlexisDerumigny, @BenWiseman, @billdenney, @bobjansen, @brry, @cderv, @cjyetman, @courtiol, @DanChaltiel, @danielvartan, @DarioS, @DavisVaughan, @dieghernan, @dmurdoch, @dwachsmuth, @flrd, @gaborcsardi, @hadley, @IndrajeetPatil, @JantekM, @jennybc, @karoliskoncevicius, @kongdd, @kpagacz, @lionel-, @lorenzwalthert, @maelle, @malcolmbarrett, @mbojan, @MichaelChirico, @mine-cetinkaya-rundel, @MislavSag, @mschilli87, @Nelson-Gon, @netique, @pnacht, @ramiromagno, @romainfrancois, @saicharanp18, @simonsays1980, @ThierryO, @wch, @wurli, and @yogat3ch.

Contents