Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R CMD check NOTE: Namespace in Imports field not imported

Tags:

r

devtools

I continue to get the following R CMD check (via devtools::check()) for a package I am preparing to submit to CRAN (you can see the results for the package here:

Check: dependencies in R code 
Result: NOTE 
    Namespace in Imports field not imported from: ‘tidyr’
     All declared Imports should be used. 

The source code for the package is here on GitHub. I've removed any mention of tidyr or its functions throughout the package, but the note remains. There are a number of Stack Overflow questions (i.e., this and other resources on this, but none seem to apply to this situation. How can I address this note?

like image 954
Joshua Rosenberg Avatar asked Nov 30 '25 01:11

Joshua Rosenberg


1 Answers

This message appears when you include a package in the Imports: field in DESCRIPTION file and no function in this namespace is called by any function of the package. In this case, it means that in the R code of the package there was no call like tydir::fun, where fun represents any function of that package.

To solve it, simply delete the reference to the package in Imports: field within DESCRIPTION file. This was fixed in this commit for the package involved in the question: clustRcompaR.

If you don't want the message to appear when you check the package using devtools:check(), set option CRAN = FALSE: devtools::check(CRAN = FALSE)

like image 177
josep maria porrà Avatar answered Dec 02 '25 14:12

josep maria porrà



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!