I'm developing a local package
bitstomach which depends on another local package 'spekex'. Both are installed locally at
~/R/x86_64-pc-linux-gnu-library/dev/. The path that directory is added to .libPath in my ~/.Rprofile
- Ubuntu 18.04
- R version 3.6.1
- RStudio 1.2.1335
When I use the IDE's Build Source Package, I receive an error that the other local package,
spekex, is not available.
Updating bitstomach documentation Loading bitstomach Error: Dependency package(s) 'spekex' not available. Backtrace: █ 1. ├─base::suppressPackageStartupMessages(...) 2. │ └─base::withCallingHandlers(expr, packageStartupMessage = function(c) invokeRestart("muffleMessage")) 3. └─devtools::document(roclets = c("rd", "collate", "namespace")) 4. ├─withr::with_envvar(...) 5. │ └─base::force(code) 6. └─roxygen2::roxygenise(pkg$path, roclets) 7. └─roxygen2:::load_code(base_path) 8. └─pkgload::load_all(path, compile = FALSE, helpers = FALSE, attach_testthat = FALSE) 9. └─pkgload:::load_imports(path) 10. └─pkgload:::abort_for_missing_packages(res, imports$package)
It appears that the issue arises from using roxygen. Turning off the "Generate documentation with Roxygen" avoids the error.
It appears that .Rprofile is not being read so libPaths isn't being updated. I checked this by creating a symlink
~/R/x86_64-pc-linux-gnu-library/dev/spekex. Doing so avoids the error.
Running the command
devtools::document(roclets = c('rd', 'collate', 'namespace')) from the IDE works. Presumably because in that context the libPaths has been updated.
My issue sounds similar to this topic
Does this seem like it is a case of Roxygen not reading my .Rprofile, or there something else that might be going on?
What can I try to ensure that .Rprofile is used by Roxygen when using the IDE's Build Source Package functionality?