From 4dd8dae2a682a1875a4f75c440138039c3d214a2 Mon Sep 17 00:00:00 2001 From: Nan Xiao Date: Tue, 30 Jan 2024 10:01:29 -0500 Subject: [PATCH] Style code in `startup.R` --- inst/startup.R | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/inst/startup.R b/inst/startup.R index c1cbcf19..ac7d4a82 100644 --- a/inst/startup.R +++ b/inst/startup.R @@ -1,30 +1,28 @@ -# Project Level Setup -R_version <- "4.1.3" # set up project R version -snapshot <- "2021-08-31" # set up snapshot date -repos <- paste0("https://packagemanager.posit.co/cran/", snapshot) # set up repository based on snapshot - -home <- normalizePath(".") # set up home directory -while(! "DESCRIPTION" %in% list.files(home)){ - home <- dirname(home) +# Project-level setup +R_version <- "4.1.3" # Set up project R version +snapshot <- "2021-08-31" # Set up snapshot date +repos <- paste0("https://packagemanager.posit.co/cran/", snapshot) # Set up repository based on snapshot + +home <- normalizePath(".") # Set up home directory +while (!"DESCRIPTION" %in% list.files(home)) { + home <- dirname(home) } # A&R folder path (Do not edit information below) path <- list( - home = "", # Project home - adam = "adam", # ADaM data - output = "output" # Output - - + home = "", # Project home + adam = "adam", # ADaM data + output = "output" # Output ) path <- lapply(path, function(x) file.path(home, x)) -# Define repo URL for project specific package installation +# Define repo URL for project-specific package installation options(repos = repos) -# Check R Version -if(paste(R.version$major, R.version$minor, sep = ".") != R_version & interactive()){ - stop("The current R version is not the same with the current project in ", R_version) +# Check R version +if (paste(R.version$major, R.version$minor, sep = ".") != R_version & interactive()) { + stop("The current R version is not the same with the current project in ", R_version) } # Repository @@ -32,10 +30,12 @@ message("Current project R package repository:") message(paste0(" ", getOption("repos"))) message(" ") -# Display R Session Status -#message("R packages were installed from repo: ", options('repo'), "\n") -message("Below R package path are searching in order to find installed R pacakges in this R session:", "\n", - paste(paste0(" ", .libPaths()), collapse = "\n")) +# Display R session status +# message("R packages were installed from repo: ", options('repo'), "\n") +message( + "Below library paths are searched in order to find installed R pacakges in this R session:", "\n", + paste(paste0(" ", .libPaths()), collapse = "\n") +) message("\n") message("The project home directory is ", home)