R/inst_pkgs.R

Defines functions inst_pkgs

Documented in inst_pkgs

#' @title inst_pkgs
#' 
#' @description Install a standard list of packages
#'
#' @usage inst_pkgs()
#' 
#' @export
#' @examples
#' inst_pkgs()
#'
inst_pkgs <- function() {
  
  pkgs <- c('tidyverse', 
            'data.table', 
            'haven',
            'rcpp',
            'DT',
            'gee')
  
  inst_pkg <- function(package) {
    if(!require(package, character.only = T)) {
      paste0(package," is not installed! installing....")
      install.packages(package)
      }
  }
  
  sapply(pkgs, inst_pkg)
}
kmcconeghy/Scotty documentation built on Aug. 26, 2020, 11:45 p.m.