I just started writing a quick-dirty function to handle this, which I call stale_package_check , and I added it to my package ( funchir ); this feature is not yet included in the CRAN version.
It performs a quick (not perfect) check for all library(*) instances in the script, and then searches for a regular expression for all exported packages in the supplied file.
for example, if we save the following script as test.R:
library(data.table) library(iotools) DT = data.table(a = 1:3)
Then (from anywhere) run funchir::stale_package_check('test.R') , we get:
Functions mapped to package data .table: data.table
** No exported features associated with iotools **
It is still in beta (for example, I did not find the time to match the calls to require , currently only calls to the library ), but it is still useful.
source share