R package to converts the output of sessionInfo() to lines of RUN Rscript code for Code Ocean
Before installing the package, you need to install the n2kanalysis package from Github
# install devtools if not yet installed
# install.packages("devtools")
devtools::install_github("inbo/n2kanalysis")Afterward, you can install session2CO from GitHub:
devtools::install_github("DominikVogel/session2CO")Code Ocean allows users to specify the R packages (and their version) to be included in a Docker Image. There is also a very handy frontend where users can specify their packages. However, if you want to include a lot of packages this might be difficult.
session2CO() therefore uses the information about the uses packages provided by R via the sessionInfo() function and creates the code that can be added to the Dockerfile.
- Create your CodeOcean Capsule
- Install
session2CO - Run all your scripts, so all necessary packages are loaded
- Store the sessionInfo in a new object: e.g.
sess <- sessionInfo() - Run session2CO:
session2CO::session2CO(sess = sess, path = "sessioninfos.txt") - Copy and paste the content of the created txt file to your Dockerfile
- Run your CodeOcean Capsule