|
1 |
| -# Project Level Setup |
2 |
| -R_version <- "4.1.3" # set up project R version |
3 |
| -snapshot <- "2021-08-31" # set up snapshot date |
4 |
| -repos <- paste0("https://packagemanager.posit.co/cran/", snapshot) # set up repository based on snapshot |
5 |
| - |
6 |
| -home <- normalizePath(".") # set up home directory |
7 |
| -while(! "DESCRIPTION" %in% list.files(home)){ |
8 |
| - home <- dirname(home) |
| 1 | +# Project-level setup |
| 2 | +R_version <- "4.1.3" # Set up project R version |
| 3 | +snapshot <- "2021-08-31" # Set up snapshot date |
| 4 | +repos <- paste0("https://packagemanager.posit.co/cran/", snapshot) # Set up repository based on snapshot |
| 5 | + |
| 6 | +home <- normalizePath(".") # Set up home directory |
| 7 | +while (!"DESCRIPTION" %in% list.files(home)) { |
| 8 | + home <- dirname(home) |
9 | 9 | }
|
10 | 10 |
|
11 | 11 | # A&R folder path (Do not edit information below)
|
12 | 12 | path <- list(
|
13 |
| - home = "", # Project home |
14 |
| - adam = "adam", # ADaM data |
15 |
| - output = "output" # Output |
16 |
| - |
17 |
| - |
| 13 | + home = "", # Project home |
| 14 | + adam = "adam", # ADaM data |
| 15 | + output = "output" # Output |
18 | 16 | )
|
19 | 17 |
|
20 | 18 | path <- lapply(path, function(x) file.path(home, x))
|
21 | 19 |
|
22 |
| -# Define repo URL for project specific package installation |
| 20 | +# Define repo URL for project-specific package installation |
23 | 21 | options(repos = repos)
|
24 | 22 |
|
25 |
| -# Check R Version |
26 |
| -if(paste(R.version$major, R.version$minor, sep = ".") != R_version & interactive()){ |
27 |
| - stop("The current R version is not the same with the current project in ", R_version) |
| 23 | +# Check R version |
| 24 | +if (paste(R.version$major, R.version$minor, sep = ".") != R_version & interactive()) { |
| 25 | + stop("The current R version is not the same with the current project in ", R_version) |
28 | 26 | }
|
29 | 27 |
|
30 | 28 | # Repository
|
31 | 29 | message("Current project R package repository:")
|
32 | 30 | message(paste0(" ", getOption("repos")))
|
33 | 31 | message(" ")
|
34 | 32 |
|
35 |
| -# Display R Session Status |
36 |
| -#message("R packages were installed from repo: ", options('repo'), "\n") |
37 |
| -message("Below R package path are searching in order to find installed R pacakges in this R session:", "\n", |
38 |
| - paste(paste0(" ", .libPaths()), collapse = "\n")) |
| 33 | +# Display R session status |
| 34 | +# message("R packages were installed from repo: ", options('repo'), "\n") |
| 35 | +message( |
| 36 | + "Below library paths are searched in order to find installed R pacakges in this R session:", "\n", |
| 37 | + paste(paste0(" ", .libPaths()), collapse = "\n") |
| 38 | +) |
39 | 39 | message("\n")
|
40 | 40 |
|
41 | 41 | message("The project home directory is ", home)
|
|
0 commit comments