twidlr icon indicating copy to clipboard operation
twidlr copied to clipboard

CRAN compatability - Unexported objects imported by ':::' calls

Open drsimonj opened this issue 7 years ago • 1 comments

The use of unexported/internal functions called via ::: is not allowed by CRAN. For example, after running Rcmd check, a warning is produced:

Unexported objects imported by ':::' calls:
  'lme4:::predict.merMod' 'randomForest:::predict.randomForest'
  'rpart:::predict.rpart' 'stats:::prcomp.formula'
  'stats:::predict.prcomp' 'xgboost:::predict.xgb.Booster'
  See the note in ?`:::` about the use of this operator.
  Including base/recommended package(s):
  'stats' 'rpart'

There has been debate about this issue. For examples, see:

http://stackoverflow.com/questions/20515358/rcmd-check-unexported-objects-imported-by-calls http://stackoverflow.com/questions/32535773/using-un-exported-function-from-another-r-package https://stat.ethz.ch/pipermail/r-devel/2013-August/thread.html#67180 (Search for "[Rd] legitimate use of :::")

Overall, the advice on these links has been to either:

  1. Contact package authors and ask them to export the relevant function.
  2. Copy the function source code and cite the author appropriately.

Should CRAN be considered as an outlet for this package, this issue will need to be fixed.

drsimonj avatar May 05 '17 21:05 drsimonj

In the r-devel thread linked above, Yihui Xie posts a workaround: https://stat.ethz.ch/pipermail/r-devel/2013-August/067210.html

Although it is not an ideal solution (see answers in thread), it may be appropriate for twidlr, which (ideally) places responsibility on the model packages to get these things right.

drsimonj avatar May 06 '17 01:05 drsimonj