-
Notifications
You must be signed in to change notification settings - Fork 142
Expand file tree
/
Copy pathprofile.R
More file actions
34 lines (30 loc) · 845 Bytes
/
profile.R
File metadata and controls
34 lines (30 loc) · 845 Bytes
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
# Source the original .Rprofile
local({
try_source <- function(file) {
if (file.exists(file)) {
source(file)
TRUE
} else {
FALSE
}
}
r_profile <- Sys.getenv("R_PROFILE_USER_OLD")
Sys.setenv(
R_PROFILE_USER_OLD = "",
R_PROFILE_USER = r_profile
)
if (nzchar(r_profile)) {
try_source(r_profile)
} else {
try_source(".Rprofile") || try_source(file.path("~", ".Rprofile"))
}
invisible()
})
if (requireNamespace("sess", quietly = TRUE)) {
plot_backend <- Sys.getenv("SESS_PLOT_BACKEND", "auto")
sess::connect(
use_rstudioapi = as.logical(Sys.getenv("SESS_RSTUDIOAPI", "TRUE")),
use_httpgd = (plot_backend %in% c("auto", "httpgd")),
use_jgd = (plot_backend %in% c("auto", "jgd"))
)
}