Skip to content

Commit a444b34

Browse files
committed
update .Rprofile to work with httpgd graphics
1 parent e26c6a9 commit a444b34

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

.RProfile

+11-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
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
46
# These are built and installed for the default R version when container is built.
57

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))
811

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))

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ R-4.1.3.tar.gz
33
R-devel/
44
R-devel.tar.gz
55
/venv
6-
.cache/
6+
.cache/
7+
.Rproj.user

0 commit comments

Comments
 (0)