1
- # Temporarily use site library to initialize VSCode-R extension.
2
- # This is where packages required by VSCode-R extension are installed,
3
- # specifically jsonlite and rlang for R Session Watcher.
1
+ # Set site library for full use of VSCode-R extension.
2
+ # This is where packages required by VSCode-R extension are installed, specifically
3
+ # - jsonlite and rlang for R Session Watcher (needed to open HTML help pages)
4
+ # - languageserver for code completion
5
+ # - httpgd for http graphics device
4
6
# These are built and installed for the default R version when container is built.
5
7
6
- lp <- .libPaths() # already includes site library for default R version.
7
- .libPaths("/usr/local/lib/R/site-library")
8
+ .Library.site <- "/usr/local/lib/R/site-library"
9
+ # .libPaths() already includes site library for default R version.
10
+ .libPaths(c(.libPaths(), .Library.site))
8
11
9
- if (interactive() && Sys.getenv("RSTUDIO") == "") {
10
- source(file.path(Sys.getenv(if (.Platform$OS.type == "windows") "USERPROFILE" else "HOME"), ".vscode-R", "init.R"))
11
- }
12
-
13
- options(vsc.dev.args = list(width = 800, height = 600))
14
-
15
- # Revert to vanilla .libPaths(), so built R only has base + recommended packages
16
- .libPaths(lp)
12
+ # For PNG graphics uncomment following lines
13
+ # options(vsc.use_httpgd = FALSE,
14
+ # vsc.dev.args = list(width = 800, height = 600))
0 commit comments