Skip to content

Instantly share code, notes, and snippets.

@statzhero
Last active September 22, 2020 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save statzhero/3c259847b57419a940ccc8f5ecf163bf to your computer and use it in GitHub Desktop.
Save statzhero/3c259847b57419a940ccc8f5ecf163bf to your computer and use it in GitHub Desktop.
## SETUP AND FUNCTIONS -------------------------------------------------
load_packages <- function(x) {
# Install CRAN packages (if not already installed)
.inst <- x %in% installed.packages()
if(length(x[!.inst]) > 0) install.packages(x[!.inst])
# Load packages into session
sapply(x, require, character.only = TRUE)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment