0

I'm using Roxygen2 to document my R (3.2.4) package and have several windows open as I fix my function @examples:

1) R session where I type devtools::document() to update the Rd file

2) terminal window where I reinstall the package with the updated doc using R CMD INSTALL myPackage

3) R session where I unload/reload the package and look at the updated documentation:

> detach(package:myPackage,unload=TRUE);require(myPackage)
> ?myTestFunc

The problem is in window 3. After running the detach() and require(), typing ?myTestFunc gives me the following error:

Error in fetch(key) : 
  lazy-load database     '/Library/Frameworks/R.framework/Versions/3.2/Resources/library/netDx/help/myTestFunc.rdb' is corrupt
In addition: Warning message:
In fetch(key) : internal error -3 in R_decompress1 

Restarting R allows me to run ?myTestFunc and see the updated documentation. How do I unload and reload the package "completely" without having to start R each time?

Thanks for your time!

PS - some output from sessionInfo(), incase it helps.

> sessionInfo()
R version 3.2.4 (2016-03-10)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.5 (Yosemite)
rafa.pereira
  • 13,251
  • 6
  • 71
  • 109
  • Do you use RStudio? Because RStudio has build in tools to make building your own package very comfortable! – J_F Jun 01 '16 at 15:36
  • Hi J_F, I first tried this workflow with window 3 in RStudio. Got this error and so switched to using command-line R. Didn't help, so here I am. If you could suggest a tutorial to achieve documentation update/package reinstall/example rerun in Rstudio that would be appreciated. – Shraddha Pai Jun 01 '16 at 15:57
  • Look at this: https://support.rstudio.com/hc/en-us/articles/200486508-Building-Testing-and-Distributing-Packages My approach is the following one: (1) change your code (2) devtools::document(".") (3) CTRL + SHIFT + B to "Build & Reload" the package – J_F Jun 01 '16 at 16:26

0 Answers0