Our R scripts are used on multiple users on multiple computers and hence there are deviations in which packages are installed on each computer. To ensure that each script wo
The CRAN pacman package that I maintain can address this nicely. Using the following header (to ensure pacman is installed first) and then the p_load
function will try to load the package and then get them from CRAN if R can't load the package.
if (!require("pacman")) install.packages("pacman"); library(pacman)
p_load(qdap, ggplot2, fakePackage, dplyr, tidyr)