Skip to content

Commit 3eb5be6

Browse files
committed
install unigd as required for new R versions
1 parent a1f51c2 commit 3eb5be6

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.Rprofile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
source("~/.vscode-R/init.R")
1414
.First.sys()
1515

16-
# The remotes package is installed to install httpgd from GitHub
17-
# The gdiff package is installed to support visual difference testing
18-
1916
# Configure r-universe for binary package installations dynamically
2017
linux_binary_repo <- function(universe){
2118
runiverse <- sprintf('r-universe.dev/bin/linux/%s-%s/%s/',
@@ -29,6 +26,15 @@ linux_binary_repo <- function(universe){
2926
options(repos = c(
3027
cran = linux_binary_repo("cran")
3128
))
29+
rm(linux_binary_repo)
30+
31+
# http graphics device requires unigd to be built for current R version
32+
build_ver <- installed.packages()["unigd", "Built"]
33+
r_ver <- paste(R.version$major, substr(R.version$minor, 1, 1), sep = ".")
34+
if (substr(build_ver, 1, 3) != r_ver){
35+
message("installing unigd package (graphics backend) for R ", r_ver)
36+
suppressMessages(install.packages("unigd", quiet = TRUE))
37+
}
3238

3339
# For PNG graphics uncomment following lines
3440
# options(vsc.use_httpgd = FALSE,

.devcontainer/devcontainer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"name": "R-Dev-Env",
33
"image": "ghcr.io/r-devel/r-dev-env:devel",
4-
"runArgs": ["--cap-add=SYS_PTRACE"],
4+
"runArgs": [
5+
"--cap-add=SYS_PTRACE",
6+
"--dns=8.8.8.8"
7+
],
58
"remoteUser": "vscode",
69
"hostRequirements": {
710
"cpus": 4

0 commit comments

Comments
 (0)