Join us on Wednesday, June 3rd for a deep dive into Customer Predictive Analytics Learn more

Alternatives for setting up a Code environment (R)

Level 1
Alternatives for setting up a Code environment (R)


i need to add some packages to a code environment, but these packages cannot be installed from CRAN repo or Conda.

I succeeded to install these packages from inside a notebook using two methods:

- install.packages(packageurl, repos=NULL, type="source")

- devtools::install_github(...)


I noticed that if the packages are installed into the Code environment path, the packages will be listed in the "Actually installed packages" section (after clicking the Update button), but these packages will be lost if the environment is rebuilt

So, is there any other way to include these packages into the Code repository?


Thanks in advance!


1 Reply


Indeed you can install packages from github using these methods.

As you noted, since this is a manual operation, this will not be added to the package requirements of the code-env. Hence, these packages will be wiped if you rebuild the code-env from the UI.

To manage installation of custom R packages in a reproducible way, I suggest setting up a local repository, for example using Minicran, and host your custom package releases on this repo. In the code-env custom options you will then be able to point to this local repo.

Hopes it helps,