opensafely-core / r-docker

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

survcomp package #88

Open yinghuiwei opened 2 years ago

yinghuiwei commented 2 years ago

Could you please install survcomp package? http://www.bioconductor.org/packages/release/bioc/html/survcomp.html

Thanks!

wjchulme commented 2 years ago

HI @yinghuiwei, survcomp is no longer on CRAN, so this might be tricky to install. What is it you need it for, and can you do without it for the time being?

The package is still maintained here https://github.com/bhklab/survcomp. Have you done any non-CRAN packages before, @bloodearnest?

bloodearnest commented 2 years ago

Currently not supported I'm afraid

remlapmot commented 2 years ago

There's a small subtlety relating to Bioconductor packages that you might want to note here.

If you wanted to you could install this from its GitHub repo but the point to think through is that this package is also distributed via Bioconductor (from that GitHub source rep). Bioconductor being the other (in addition to CRAN) mainstream repository of R packages.

So you might want to consider whether to allow Bioconductor packages in this container.

The complication with Bioconductor packages is that Bioconductor works on releases which correspond to versions of R. You can see the releases here.

Whilst the code to install a Bioconductor package is simple - you just need to first install BiocManager from CRAN

install.packages("BiocManager")
BiocManager::install("survcomp")

(and it's then worth noting what version of Bioconductor you have - I think you'd get Bioconductor 3.12 for the R 4.0.2 currently in the container.)

BiocManager::version()

The thing to be aware of (and probably/possibly not worry about), is that you will then very likely find that you have what Bioconductor considers to be an invalid Bioconductor installation

BiocManager::valid()

which will most likely be caused by the survcomp dependency packages not being at the version numbers Bioconductor considers they should be at for that version of Bioconductor.

E.g. you can see from its Bioconductor version 3.12 page here that survcomp was at version 1.40.0 for that Bioconductor release.

yinghuiwei commented 2 years ago

Thank you @remlapmot @wjchulme @bloodearnest , I will look into the details of the suggested solutions!