## 2017/17/11

I tend to use package managers for library load and management: pacman

https://cran.r-project.org/web/packages/pacman/vignettes/Introduction_to_pacman.html

library(dplyr)
library(tidyr)
library(Hmisc)
library(magrittr)
library(janitor)

You can write one line

pacman::p_load(dplyr, tidyr, Hmisc, janitor, magrittr)

if the package is not available on the system, it will first install it (through install.packages), and only then try to load it again. Same as library installr

installr::require2

All of this, on the very first part of any R file.