A package I'm working on uses purrr::map_dfr() internally in some of its functions. Both purrr and dplyr are included in the Imports in my Description file.
Both examples and tests obviously include these functions using purrr::map_dfr() internally, and when run e.g. with devtools::test() all works fine, all tests are passed. However, when I run devtools::check() I get the following error:
Error: `map_df()` requires dplyr
This is puzzling, as dplyr is imported. Also, I run multiple checks both with Rhub and on Github and none throws the same error.
I'm on the latest Fedora, R4.0.4, all packages are up to date. Any idea on how to troubleshoot this further?
Looking for the error message online I found only references to old issues and debates, which should not be relevant in my case.
I asked here somehow expecting I was missing something obvious and silly, not sure it's worth troubleshooting in depth.
rhub::check_for_cran() and on checks run on GitHub are mostly happy with it, however, so it must be something on my machine that does no harm (except depriving me of the joy of seeing the three 0/0/0 after checks).
On my machine, I still see that error with purrr, as well as another one, Error: there is no package called 'generics'
If there's some input as to what may be causing it, I'm happy to check this out, or I'll try to troubleshoot this further seeing results with other packages. If not, no big deal, I'll ignore those errors and rely on the rest.
I tried a couple of things, including different rhub platforms and all was fine. Eventually, I re-cloned the package in a new folder and project, activated renv, installed packages. And... everything worked fine, from the project with renv enabled.
So I thought I'd just wipe my R folder with all packages, and install them anew. But no, I had even more errors, with other packages, besides purrr and dplyr, such as httr.
I then installed manually all these packages with install.package(), and... now all is fine.
In brief, the issue must be that packages that are installed via the OS package manager are not visible to devtools::check(). To make them available to check, I apparently need to install them again from inside R, even if otherwise everything works just fine.
(Fedora has in its repo many R packages, that I installed with something like sudo dnf install R-httr... these are useful, as they solve a number of issues with dependencies).