A more reproducible approach w.r.t. to packaging is using renv instead of the install.R file. Thus I wonder whether the template could be extended to handle renv packaging as well?
Essentially one could add the following line to the template:
RUN if [ -f renv.lock ]; then R -e "renv::restore()"; fi
However, maybe some further changes might be needed, e.g. not having the files directly in the home directory of the NB_USER but rather in a subdirectory of it. At least that was what I came up after some try-and-error work.
A more reproducible approach w.r.t. to packaging is using
renvinstead of theinstall.Rfile. Thus I wonder whether the template could be extended to handlerenvpackaging as well?Essentially one could add the following line to the template:
However, maybe some further changes might be needed, e.g. not having the files directly in the home directory of the NB_USER but rather in a subdirectory of it. At least that was what I came up after some try-and-error work.