I am working on a family of R-packages, all of which have a common common code, which is located in an internal package, allows you to call it myPackageUtilities. Therefore, I have several packages
myPackage1, myPackage2etc.
All of these packages depend on each method in myPackageUtilities. For an example in the real world, see statnet on CRAN . Of course, every dependent package has
Depends: myPackageUtilities
in the DESCRIPTION file.
My question: In R code, it is myPackage1preferable to use one of the following two methods to access methods from myPackageUtilities:
- Use
:::to access methods in myPackageUtilitiesor - Export all from
myPackageUtilities(e.g. include exportPattern("^[^\\.]")in NAMESPACE)
Option 2 clutters the end user search path, but R gurus are advised not to use it :::.
Follow-up question: If (2) is the best choice, is there a way to export everything with roxygen2?
source
share