I am working on an internal package. Because I use dplyr a lot it and it is for my own use only, it seems sensible to import it. I added the roxygen tag #' import dplyr to my code and after running devtools::document() the tag import(dplyr) indeed was added to the NAMESPACE file.
I expected that after running devtools::load_all() the functions from dplyr would now be available. However, this is not the case. Functions calling dplyr functions break with "could not find ..." error message. What am I overlooking or misunderstanding? Thanks!
You must use dplyr::function to call a function. If you really want to load dplyr in your project, you can do it with library. However, the latter is not recommended in most cases. If this doesn't work, then dplyr might not be installed.
Thanks for your reply, but I think you are mixing up the Imports field in the DESCRIPTION file with adding import(pkg) to the NAMESPACE. I am referring to the latter, this should load all the functions from the package. In case of the former you should indeed refer to functions with pkg::fun.