Stumbled upon a great R package that streamlines the sometimes contentious install.packages() and library() or require() functions. Pacman allows you to install, load, or unload packages by simply passing through a list of packages from the start. See below an example I’m referring to:
What’s normally done to load R packages …
packs <- c("XML", "devtools", "RCurl", "fakePackage", "SPSSemulate")
success <- suppressWarnings(sapply(packs, require, character.only = TRUE))
install.packages(names(success)[!success])
sapply(names(success)[!success], require, character.only = TRUE)
What pacman does instead …
pacman::p_load(XML, devtools, RCurl, fakePackage, SPSSemulate)
Pretty cool, right? Saves tons of time.

