-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.Rprofile
43 lines (38 loc) · 1.47 KB
/
.Rprofile
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
39
40
41
42
43
if (file.exists("renv/activate.R")) {
source("renv/activate.R")
cat("
--------------------------------------------------------------------------------
Welcome to the CRI iAtlas Shiny App
--------------------------------------------------------------------------------
\n")
if (length(find.package("devtools", quiet=T)) == 0 || length(find.package("renv", quiet=T)) == 0) {
# prompt instead since RStudio won't show progress for slow .RProfile scripts...
cat("TODO: Install package requirements. This may take up to an hour the first time.\n")
cat("RUN: source('./install_and_init.R')\n")
} else {
# auto-run since it should be quick, but makes sure any new requirements are installed.
source('./install_and_init.R')
}
} else if (Sys.getenv("R_CONFIG_ACTIVE") == "shinyapps") {
cat("
--------------------------------------------------------------------------------
CRI iAtlas Shiny App: Production
--------------------------------------------------------------------------------
\n")
source('./init.R')
}
# For Ubuntu 18.04 (also known as Bionic)
options(repos = c(
REPO_NAME = "https://packagemanager.rstudio.com/all/__linux__/bionic/latest",
getOption("repos")
))
# For Ubuntu 20.04 (also known as Focal)
options(repos = c(
REPO_NAME = "https://packagemanager.rstudio.com/all/__linux__/focal/latest",
getOption("repos")
))
if (interactive()) {
suppressMessages(require(devtools))
suppressMessages(require(testthat))
suppressMessages(require(usethis))
}