R/env_check.R

Defines functions env_check

Documented in env_check

#' check the environment for necessary packages, and install the missing packages
#' @export env_check
#' @examples
#' env_check()

env_check <- function(){
  if("mgcv" %in% rownames(installed.packages()) == FALSE)
  {install.packages("mgcv")
  }
  library("mgcv")

  if("MASS" %in% rownames(installed.packages()) == FALSE)
  {install.packages("MASS")
  }
  library("MASS")

  if("gtools" %in% rownames(installed.packages()) == FALSE)

  {install.packages("gtools")
  }
  library("gtools")

  if("glmnet" %in% rownames(installed.packages()) == FALSE)
  {install.packages("glmnet")
  }
  library("glmnet")

  if("Matrix" %in% rownames(installed.packages()) == FALSE)
  {install.packages("Matrix")
  }
  library("Matrix")

  if("doParallel" %in% rownames(installed.packages()) == FALSE)
  {install.packages("doParallel")
  }
  #library("doParallel")

  if("parallel" %in% rownames(installed.packages()) == FALSE)
  {install.packages("parallel")
  }
  library("parallel")

  if("splines" %in% rownames(installed.packages()) == FALSE)
  {install.packages("splines")
  }
  library("splines")
}
echi/mSIM documentation built on Oct. 6, 2020, 11:09 a.m.