inst/examples/main_lib.R

libs <- c(
  "actuar", warn.conflicts=FALSE,
  "additivityTests",
  "agricolae",
  "Amelia",
  "andrews",
  "ape",
  "aplpack",
  "ash",
  "boot",
  "car",
  "CHAID",
  "cluster",
  "deldir",
  "DescTools",
  "devtools",
  "digest",
  "e1071",
  "entropy",
  "flexclust",
  "foreign",
  "fpc",
  "gam",
  "GGally",
  "ggmap",
  "ggplot2",
  "glmnet",
  "gplots",
  "haven",
  "hexbin",
  "Hmisc",
  "igraph",
  "lattice",
  "latticeExtra",
  "lawstat",
  "lmtest",
  "locfit",
  "MASS",
  "mclust",
  "mgcv",
  "mice",
  "MissingDataGUI",
  "mitools",
  "mlbench",
  "moments",
  "NbClust",
  "neuralnet",
  "nnet",
  "nortest",
  "np",
  "OpenStreetMap",
  "outliers",
  "paran",
  "perturb",
  "plotrix",
  "proxy",
  "pscl",
  "psych",
  "qualityTools",
  "QuantPsyc",
  "randomForest",
  "RColorBrewer",
  "RCurl",
  "reshape2",
  "rggobi",
  "rgl",
  "rmarkdown",
  "robustbase",
  "rpart",
  "ryouready",
  "sampling",
  "scagnostics",
  "scatterplot3d",
  "shiny",
  "shinydashboard",
  "shinyFiles",
  "shinyjs",
  "sm",
  "spdep",
  "stringi",
  "stringr",
  "tabplot",
  "TeachingDemos",
  "tibble",
  "UsingR",
  "vcd",
  "vcdExtra",
  "vioplot",
  "xlsx",
  "xtable"
)
status <- rep(NA, length(libs)); names(status) <- libs
pkgs   <- installed.packages()[,1]
for (lib in libs) {
  if (lib %in% pkgs) {
    status[lib] <- TRUE
  } else { 
    try(install.packages(lib), silent=TRUE)
    pkgs   <- installed.packages()[,1]
    status[lib] <- (lib %in% pkgs)
  }
  print(status[lib])
}
status[!status]
sigbertklinke/shinyExample documentation built on May 26, 2019, 4:32 a.m.