简体   繁体   中英

Removing unused libraries in R

So I just finished up writing my first script to assemble a Weibull Analysis from a text file. In all of my tinkering I suspect I may have loaded some libraries that aren't used in the final script. Is there a quick way to check which libraries are being used by the script without checking each function?

If you attach libraries via library or require it's easiest to search your code for those. If you call libraries without attaching them via <library>::<export> syntax then search for :: . If you're worried about transitive dependencies or just generally would like to create a reproducible environment look at the packrat package: http://rstudio.github.io/packrat/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM