RBBGCMuso/installDeps.R
2019-04-15 12:51:45 +02:00

19 lines
618 B
R

(function(){
packagesToInstall <- c("shiny","shinyjs","plotly","promises","future","data.table","rhandsontable", "dplyr", "digest", "ggplot2", "magrittr", "tibble", "limSolve", "rmarkdown")
installedp<- sapply(packagesToInstall, function(pkgs){
if(!is.element(pkgs,installed.packages()[,1])){
install.packages(pkgs)
if(!is.element(pkgs,installed.packages()[,1])){
return(FALSE)
} else {
return(TRUE)
}
} else {
return(TRUE)
}
})
if(any(!installedp)){
stop("The installation process was not successful. Please try rerun the installation!")
}
})()