#' 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")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.