Can Rcpp package DLLs be unloaded without restarting R?

前提是你 提交于 2019-12-05 12:16:31

If you want to do this in your main R session (without using RStudio, which makes reinstalling the package and reloading R very easy), you can use devtools:

library(devtools)
load_all("path/to/my/package")

Among other things, load_all will reload all your R code, and re-compile and reattach the DLL.

Opinions are divided on this. I often prefer to run the builds and test outside of my main R session(s), simply by chaining R CMD INSTALL with Rscript (or, on Linux, r calls from littler) to test the new build. If you use proper options to R CMD INSTALL ... to skip parts that may take extra time you get a quick turnaround AND are assured that you do get a fresh build.

And if you want the same behaviour by clicking a button, RStudio offers it too.

I guess you need to run library.dynam.unload to unload DLLs.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!