-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.R
More file actions
38 lines (29 loc) · 1.13 KB
/
install.R
File metadata and controls
38 lines (29 loc) · 1.13 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
# Custom installation script for RStudio Connect
# Remove any system library paths to avoid conflicts
.libPaths(.libPaths()[1])
# Set environment to avoid using system libraries during compilation
Sys.setenv(R_LIBS_USER = .libPaths()[1])
Sys.setenv(R_LIBS = .libPaths()[1])
# Configure options
renv::settings$install.packages.compile.from.source("never")
options(install.packages.compile.from.source = "never")
options(pkgType = "binary")
# Restore packages
renv::restore()
# If SparseArray fails, try manual installation
if (!requireNamespace("SparseArray", quietly = TRUE)) {
message("SparseArray not found after restore, attempting manual installation...")
if (!requireNamespace("BiocManager", quietly = TRUE)) {
install.packages("BiocManager")
}
# Force removal of any cached/partial installations
try(remove.packages("SparseArray"), silent = TRUE)
# Install with binary preference
BiocManager::install("SparseArray",
version = "3.20",
ask = FALSE,
force = TRUE,
type = "binary")
}
# Update snapshot
renv::snapshot(type = "all")