Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rd created without export

Tags:

r

roxygen2

I'm documenting an internal, non-exported function. roxygen2 is creating an Rd file even though there is no @export tag in the documentation. roxygen2 created an Rd file for the following documentation. What am I missing?

    #' Check validity of a
    #' @param a A logical value
    arg_check_a = function(a) {
      if (!is.logical(a)) {
        stop("a must be a logical value")
      }
    }
like image 944
jfrench Avatar asked Feb 10 '26 22:02

jfrench


1 Answers

Use @noRd.

Use the @noRd tag to prevent .Rd files from being generated.

I'm also a fan of marking them #' @keywords internal, which (according to the vignettes):

@keywords internal is useful because it removes the function from the documentation index; it’s useful for functions aimed primarily at other developers, not typical users of the package.

(Most of this is derived from https://github.com/r-lib/roxygen2/issues/684)

like image 137
r2evans Avatar answered Feb 12 '26 16:02

r2evans



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!