opensafely-core / r-docker

Docker image for running R scripts in OpenSAFELY
1 stars 3 forks source link

Add DiagrammeR package to OpenSAFELY R image #148

Closed acagreen17 closed 10 months ago

acagreen17 commented 10 months ago

Package that makes drawing network graphs (i.e. flowcharts) easy(ish!) in R. Would prefer to do this on the server for now.

Cran page: https://cran.r-project.org/web/packages/DiagrammeR/index.html

iaindillingham commented 10 months ago

Any objections, @wjchulme?

wjchulme commented 10 months ago

All good!

iaindillingham commented 10 months ago

Thanks, Will. Doing this now, @acagreen17.

evansd commented 10 months ago

Installing this seems to require upgrading some other packages. Specifically it complains:

After upgrading these two package the install completes successfully, but results in changes to quite a few packages:

diff --git a/packages.csv b/packages.csv
index f1b3456..9cae014 100644
--- a/packages.csv
+++ b/packages.csv
@@ -54,3 +54,3 @@
 "coxme","2.2-16"
-"cpp11","0.2.7"
+"cpp11","0.4.6"
 "crayon","1.3.4"
@@ -68,2 +68,3 @@
 "DHARMa","0.4.6"
+"DiagrammeR","1.0.10"
 "digest","0.6.25"
@@ -71,3 +72,4 @@
 "doParallel","1.0.15"
-"dplyr","1.0.2"
+"downloader","0.4"
+"dplyr","1.1.3"
 "DT","0.15"
@@ -96,3 +98,3 @@
 "fastDummies","1.6.3"
-"fastmap","1.0.1"
+"fastmap","1.1.1"
 "fastshap","0.0.7"
@@ -145,3 +147,3 @@
 "globals","0.12.5"
-"glue","1.4.2"
+"glue","1.6.2"
 "Gmisc","2.0.1"
@@ -165,3 +167,3 @@
 "htmlTable","2.0.1"
-"htmltools","0.5.0"
+"htmltools","0.5.6"
 "htmlwidgets","1.5.1"
@@ -170,3 +172,3 @@
 "IDPmisc","1.1.20"
-"igraph","1.2.5"
+"igraph","1.5.1"
 "incidence","1.7.3"
@@ -266,3 +268,3 @@
 "PHEindicatormethods","1.3.2"
-"pillar","1.4.6"
+"pillar","1.9.0"
 "pkgbuild","1.1.0"
@@ -317,3 +319,3 @@
 "rdrobust","2.1.1"
-"readr","1.3.1"
+"readr","2.1.4"
 "readxl","1.3.1"
@@ -388,6 +390,6 @@
 "threejs","0.3.3"
-"tibble","3.0.3"
+"tibble","3.2.1"
 "tictoc","1.0"
 "tidyr","1.1.2"
-"tidyselect","1.1.0"
+"tidyselect","1.2.0"
 "tidyverse","1.3.0"
@@ -399,2 +401,3 @@
 "twopartm","0.1.0"
+"tzdb","0.4.0"
 "units","0.6-7"
@@ -407,5 +410,7 @@
 "VGAM","1.1-6"
-"viridis","0.5.1"
-"viridisLite","0.3.0"
+"viridis","0.6.4"
+"viridisLite","0.4.2"
 "visdat","0.5.3"
+"visNetwork","2.1.2"
+"vroom","1.6.3"
 "webshot","0.5.2

I don't know enough about the R ecosystem to know whether any of this upgrades are likely to be problematic for existing code. Can someone (@wjchulme?) look into this and make a decision?

I have the DiagrammeR package built locally and ready to push whenever we decide this is OK.

wjchulme commented 10 months ago

I expect most of these updates will be welcomed by users as it'll provide a few more features, and using any deprecated features will most like warn, not fail. It will also better align the opensafely image with users' local R installs, so they can finally update their code so that annoying deprecation messages in server-side log files go away (eg the path/file argument update all the way back in readr v.1.4.0!)

The only major update is to readr and so there may be some subtle breaking changes here, and possibly across other updates. I would include an item about this update in platform news, and warn people to look out for them.

remlapmot commented 10 months ago

... It will also better align the opensafely image with users' local R installs,

@wjchulme especially for Windows users if you want a local recreation of the packages at the versions in the image - you can do this on Windows by installing R 4.0.5 (binary installer still available from CRAN) and using the renv.lock file from the r image. I've put a repo to clone with instructions here https://github.com/remlapmot/renv-r-docker#readme.

It's pretty straightforward and will live happily alongside other R versions on your Windows machine.