R/Packages_Install.R

## If a package is installed, it will be loaded. If any
## are not, the missing package(s) will be installed
## from CRAN and then loaded.

## First specify the packages of interest
packages = c("devtools", "roxygen2", "readr", "dplyr", "tidyr", "maps", "graphics")

## Now load or install&load all
package.check <- lapply(
  packages,
  FUN = function(x) {
    if (!require(x, character.only = TRUE)) {
      install.packages(x, dependencies = TRUE)
      library(x, character.only = TRUE)
    }
  }
)
RG9303/Project-RG-Package documentation built on June 16, 2020, 3 p.m.