-
Notifications
You must be signed in to change notification settings - Fork 33
/
.Rprofile
25 lines (23 loc) · 838 Bytes
/
.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
# Source: https://renkun.me/2020/04/14/writing-r-in-vscode-working-with-multiple-r-sessions/
Sys.setenv(TERM_PROGRAM = "vscode")
source(file.path(
Sys.getenv(
if (.Platform$OS.type == "windows") "USERPROFILE" else "HOME"
),
".vscode-R", "init.R"
))
# Source: https://github.com/REditorSupport/vscode-R/wiki/Plot-viewer#svg-in-httpgd-webpage
if (interactive() && Sys.getenv("TERM_PROGRAM") == "vscode") {
if ("httpgd" %in% .packages(all.available = TRUE)) {
options(vsc.plot = FALSE)
options(device = function(...) {
httpgd::hgd(silent = TRUE)
.vsc.browser(httpgd::hgd_url(history = FALSE), viewer = "Beside")
})
}
}
# Set CRAN Mirror
options(repos = c(CRAN = Sys.getenv("CRAN_MIRROR")))
options(repos = c(CRAN = "https://cran.rstudio.com/"))
options(repos = c(CRAN = "https://cran.rstudio.com/"))
#