I have a package containing the following Imports package in a DESCRIPTION file:
Imports: lubridate, assertthat, R6, stringr
I do not import them into my NAMESPACE package using the import(pkgname) or importFrom(pkgname, fn) commands. Rather, I refer to these package functions in my R code using a fully qualified call. Based on my reading of R-ext , this is valid:
The Import field lists packages whose namespaces are imported (as indicated in the NAMESPACE file), but which do not need to be attached. The namespaces accessed by the ':: and': operators should be listed here ...
However, when I run devtools::check() I get the following error:
* checking dependencies in R code ... NOTE Namespaces in Imports field not imported from: 'R6' 'stringr' All declared Imports should be used. See the information on DESCRIPTION files in the chapter 'Creating R packages' of the 'Writing R Extensions' manual.
NB: for confirmation, my R code contains fully qualified function calls in R6 and stringr (e.g. stringr::str_detect(...) and R6::R6Class(...) ).
Why am I getting these notes? And how do I get them to leave?
source share