2
votes

I have an R package that was getting too big, so I split out a coherent chunk of it into a new package.

I want to provide a deprecation period for users who might have been relying on those functions, so I did this:

##' Blah blah function
##'
##' Deprecated - use `newpack::blah` instead.
##' @export
blah <- newpack::blah

One drawback is that R CMD CHECK warnings caused by newpack::blah are now warnings in this package:

Undocumented arguments in documentation object 'blah'
    ‘x’ ‘...’

What's a better way?

1

1 Answers

3
votes

Because of R's deep copying semantics, doing blah <- newpack::blah actually deeply copies the newpack::blah function into the current package, rather than just referring to it by name.

Instead of copying from one namespace to the other, import blah and re-export it:

##' Blah blah function
##'
##' Deprecated - use `newpack::blah` instead.
##' @importFrom newpack blah
##' @export blah
##' @name blah
NULL