Setup R libraries path for RStudio
This makes sure our base R install (used by the notebook kernel) and
RStudio share the same packages.
MODIFY
repo2docker/buildpacks/r.py
repo2docker/buildpacks/r.py
@@ -155,6 +155,16 @@ class RBuildPack(PythonBuildPack):
rstudio_checksum=rstudio_checksum
)
),
+ (
+ "root",
+ # Set paths so that RStudio shares libraries with base R
+ # install. This first comments out any R_LIBS_USER that
+ # might be set in /etc/R/Renviron and then sets it.
+ r"""
+ sed -i -e '/^R_LIBS_USER=/s/^/#/' /etc/R/Renviron && \
+ echo "R_LIBS_USER=${R_LIBS_USER}" >> /etc/R/Renviron
+ """
+ ),
(
"${NB_USER}",
# Install nbrsessionproxy

Setup R libraries path for RStudio

This makes sure our base R install (used by the notebook kernel) and
RStudio share the same packages.