-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_R_packages.R
54 lines (47 loc) · 1.12 KB
/
install_R_packages.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# functions to install a package if it's missing
install_if_missing <- function(package) {
if (!requireNamespace(package, quietly = TRUE)) {
install.packages(package)
}
}
install_if_missing("devtools")
install_github_if_missing <- function(package, repo) {
if (!requireNamespace(package, quietly = TRUE)) {
devtools::install_github(repo)
}
}
packages <- c(
"ComplexUpset",
"MetBrewer",
"UpSetR",
"dplyr",
"fmsb",
"forcats",
"gg.gap",
"ggcorrplot",
"ggplot2",
"ggplot2movies",
"ggpmisc",
"ggpubr",
"ggrepel",
"grid",
"gridExtra",
"gt",
"hrbrthemes",
"huxtable",
"patchwork",
"reshape2",
"scales",
"tidyr",
"viridis",
"svglite",
"tidyverse"
)
lapply(packages, install_if_missing)
install_github_if_missing("ggbreak", "YuLab-SMU/ggbreak")
install_github_if_missing("RColorConesa", "ConesaLab/RColorConesa")
# Load the packages
lapply(packages, library, character.only = TRUE)
# Local Variables:
# ess-indent-offset: 2
# End: