forked from davesteps/homebrewR
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.R
More file actions
23 lines (17 loc) · 705 Bytes
/
init.R
File metadata and controls
23 lines (17 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Example R code to install packages
# See http://cran.r-project.org/doc/manuals/R-admin.html#Installing-packages for details
#
###########################################################
# Update this line with the R packages to install:
my_packages = c("shiny",'shinyjs','dplyr','shinydashboard','Cairo',
'gridExtra','ggplot2','reshape2','wesanderson')
###########################################################
install_if_missing = function(p) {
if (p %in% rownames(installed.packages()) == FALSE) {
install.packages(p, dependencies = TRUE)
}
else {
cat(paste("Skipping already installed package:", p, "\n"))
}
}
invisible(sapply(my_packages, install_if_missing))