Created
November 28, 2019 06:31
-
-
Save MarkZhangTW/7bf68df40a9cb09a399379fa2dd48dad to your computer and use it in GitHub Desktop.
detach all required packages in R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (package in sessionInfo()$otherPkgs) | |
detach(paste0('package:', package$Package), character.only = TRUE) | |
# or | |
lapply(X = sessionInfo()$otherPkgs, FUN = function(package) | |
{ detach(paste0('package:', package$Package), character.only = TRUE)}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
installed.packages()[,c("Package", "Version")]