Created
May 19, 2014 02:03
-
-
Save gu-mi/05d73cd1b7736f849fe2 to your computer and use it in GitHub Desktop.
Detect which packages are not installed, and then install them and load all required packages into session.
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
# check if you need to install these packages | |
pkg <- c("RODBC", "ggplot2") | |
inst <- pkg %in% installed.packages() | |
# inst | |
if (length(pkg[!inst]) > 0) { | |
install.packages(pkg[!inst]) | |
} | |
# load all required packages into session | |
lapply(pkg, library, character.only = TRUE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment