-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.R
More file actions
49 lines (43 loc) · 1.09 KB
/
Copy pathinstall.R
File metadata and controls
49 lines (43 loc) · 1.09 KB
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
# Install required packages
if (!requireNamespace("devtools", quietly = TRUE)) {
install.packages("devtools", repos = "https://cloud.r-project.org")
}
install_if_missing <- function(packages) {
for (pkg in packages) {
if (!requireNamespace(pkg, quietly = TRUE)) {
message("Installing ", pkg)
install.packages(pkg, dependencies = TRUE, repos = "https://cloud.r-project.org")
} else {
message(pkg, " is already installed")
}
}
}
required_cran <- c(
"Seurat",
"SeuratObject",
"igraph",
"Matrix",
"parallel",
"ggplot2",
"devtools",
"roxygen2"
)
optional_cran <- c(
"leiden",
"viridis",
"RColorBrewer",
"gridExtra",
"knitr",
"rmarkdown",
"testthat"
)
message("Installing required packages...")
install_if_missing(required_cran)
message("Installing optional packages...")
install_if_missing(optional_cran)
Sys.setenv(R_TESTS = "")
options(repos = c(CRAN = "https://cloud.r-project.org"))
message("Installing scICER package...")
pkg_dir <- getwd()
install.packages(pkg_dir, repos = NULL, type = "source")
message("scICER package installed successfully!")