Skip to content

Commit ba1d3e7

Browse files
authored
Merge pull request #35 from nanxstats/main
Style code in `startup.R`
2 parents 56308ab + 4dd8dae commit ba1d3e7

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

inst/startup.R

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
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)
99
}
1010

1111
# A&R folder path (Do not edit information below)
1212
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
1816
)
1917

2018
path <- lapply(path, function(x) file.path(home, x))
2119

22-
# Define repo URL for project specific package installation
20+
# Define repo URL for project-specific package installation
2321
options(repos = repos)
2422

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)
2826
}
2927

3028
# Repository
3129
message("Current project R package repository:")
3230
message(paste0(" ", getOption("repos")))
3331
message(" ")
3432

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+
)
3939
message("\n")
4040

4141
message("The project home directory is ", home)

0 commit comments

Comments
 (0)