|
14 | 14 | # You should have received a copy of the GNU General Public License |
15 | 15 | # along with structure_threader. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 |
|
| 17 | +## Default repo |
| 18 | +local({r <- getOption("repos") |
| 19 | +r["CRAN"] <- "http://cran.r-project.org" |
| 20 | +options(repos=r) |
| 21 | +}) |
| 22 | + |
17 | 23 | ll = Sys.getenv()[ grep("R_LIBS_USER", names(Sys.getenv())) ] |
18 | | -local_lib = gsub("^.*\t", "", ll) |
| 24 | +local_lib = gsub(".*~", path.expand('~'), as.character(ll), perl=T) |
| 25 | + |
| 26 | +if (dir.exists(local_lib) == FALSE) { |
| 27 | + dir.create(local_lib, showWarnings = TRUE, recursive = TRUE) |
| 28 | +} |
| 29 | + |
| 30 | +.libPaths(c(local_lib)) |
19 | 31 |
|
20 | 32 | if(!require("alstructure")){ |
21 | 33 | if(!require("devtools")){ |
22 | | - install.packages("devtools", lib=.libPaths()[1]) |
| 34 | + install.packages("devtools") |
23 | 35 | } |
24 | 36 | library("devtools") |
25 | | - install_github("storeylab/alstructure", build_vignettes=FALSE, ref="e355411", lib=.libPaths()[1]) |
| 37 | + install_github("storeylab/alstructure", build_vignettes=FALSE, ref="e355411") |
26 | 38 | library(alstructure) |
27 | 39 | } |
28 | 40 |
|
29 | 41 | if(!require(lfa)){ |
30 | 42 | if (!requireNamespace("BiocManager", quietly = TRUE)) |
31 | | - install.packages("BiocManager", lib=.libPaths()[1]) |
| 43 | + install.packages("BiocManager") |
32 | 44 |
|
33 | | - BiocManager::install("lfa", lib=.libPaths()[1]) |
| 45 | + BiocManager::install("lfa") |
34 | 46 | library(lfa) |
35 | 47 | } |
36 | 48 |
|
|
0 commit comments