Package imports error on devtools::check()

巧了我就是萌 提交于 2019-12-30 06:23:11

问题


I have a package that contains the following package Imports in the DESCRIPTION file:

Imports: lubridate,
    assertthat,
    R6,
    stringr

I don't import these into my package's NAMESPACE using an import(pkgname) or importFrom(pkgname, fn) commands. Rather I refer to these package's functions in my R code using a fully qualified call. Based on my reading of R-ext, this is permissible:

The ‘Imports’ field lists packages whose namespaces are imported from (as specified in the NAMESPACE file) but which do not need to be attached. Namespaces accessed by the ‘::’ and ‘:::’ operators must be listed here...

However, I get the following error when I run devtools::check():

* 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: to confirm, my R code contains fully qualified calls to functions in R6 and stringr (e.g. stringr::str_detect(...) and R6::R6Class(...)).

Why am I getting these notes? And how do I make them go away?

来源:https://stackoverflow.com/questions/28335991/package-imports-error-on-devtoolscheck

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!