Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does roxygen2 6.0.0 now require "@export" in the last line?

Tags:

Prior to updating to roxygen2 version 6.0.0, it appeared that the package supported using the @export tag not at the bottom of the function header in a package. For instance:

#' Title #' @param foo #' @return bar #' #' @export #' #' @seealso Other blah blah 

The code above would build successfully with roxygen2 properly filling out the namespace when using my installation of roxygen2 version 5.0.1. However, with the update this form of documentation would not work and roxygen2 actively removes it from the NAMESPACE.R.

I could fix this by moving @export to the bottom

#' Title #' @param foo #' @return bar #' #' @seealso Other blah blah #' @export 

My question is whether this issue occurs by design? I can't see anything specifying this change to @export in the release notes: https://github.com/klutometis/roxygen/releases/tag/v6.0.0

Was this always how roxygen2 was supposed to work and the operation up until this point was unintended? Or is this a deliberate change?

N.B. Obviously making a full mwe for different versions is difficult, any suggestions on how to tackle this welcome

EDIT: After further testing I'm beginning to suspect that there is more to this than just roxygen. I am using the build and document shortcuts in rstudio, which I also update recently, and even stepping back to roxygen2 version 5.0.1 stops me rebuilding the documentation of the old functions that used to work.

like image 960
DaveRGP Avatar asked Feb 08 '17 14:02

DaveRGP


1 Answers

In the backlog of the Roxygen2 package there were couple of bugs related to @export in 2017.

They are fixed now and cannot be reproduced:

  • https://github.com/r-lib/roxygen2/issues/574
  • https://github.com/r-lib/roxygen2/issues/656
like image 108
Bulat Avatar answered Sep 21 '22 20:09

Bulat