Skip to content

Instantly share code, notes, and snippets.

@ZeccaLehn
Created October 11, 2017 04:55
Show Gist options
  • Save ZeccaLehn/c93150bbcae7cae459fa69e8dfd07a12 to your computer and use it in GitHub Desktop.
Save ZeccaLehn/c93150bbcae7cae459fa69e8dfd07a12 to your computer and use it in GitHub Desktop.
Install and Load Multiple Packages R
packages <- c("twitteR", "dismo", "maps", "ggplot2")
installAll <- packageList[!packages %in% rownames(installed.packages())]
if(installAll){install.packages(installAll, repos = "http://cran.us.r-project.org")} else {print("No Packages Installed")}
lapply(packages, library, character.only = TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment