opensafely-core / research-template-docker

This provides the devcontainer Docker image used by repos created from the OpenSAFELY research template.
Other
0 stars 0 forks source link

Enable loading of `tidyverse` #47

Closed StevenMaude closed 1 month ago

StevenMaude commented 1 month ago

Fixes #31.

This was discussed and we initially decided that we should fix these dependency issues on a case-by-case basis.

This was tested locally by building the Docker image and running library('tidyverse') inside.

With this commit:

> library('tidyverse')
── Attaching packages ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.3.0 ──
✔ ggplot2 3.4.2     ✔ purrr   0.3.4
✔ tibble  3.0.3     ✔ dplyr   1.0.2
✔ tidyr   1.1.2     ✔ stringr 1.4.0
✔ readr   1.3.1     ✔ forcats 0.5.0
── Conflicts ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
…

Without this commit, we get the reported behaviour in #31:

> library('tidyverse')
Error: package or namespace load failed for ‘tidyverse’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/usr/local/lib/R/site-library/xml2/libs/xml2.so':
  libxml2.so.2: cannot open shared object file: No such file or directory
StevenMaude commented 1 month ago

(I don't know R well enough — that is, at all — to know if the Conflicts listed are anything we need worry about.)