Organizing my work in distinct R projects, how can I use reticulate::conda_install() to install specific versions of python modules on a per-project basis?
Setting up reticulate, I have followed tips from this blog post. Namely, using reticulate::conda_create() and reticulate::conda_install()within the directory of the R project I'm working on.
However, for the sake of reproducibility, I want to account for the versions of python packages installed this way. How can I do so? According to the function's reference page, there's no function parameter to specify the version of the required python module being installed. Thus, if I run the same script a year from now, how could I guarantee that conda_install() would install the same versions of the python modules as installed today?
You can specify the version in the packages argument. From the documentation:
packages
A character vector, indicating package names which should be installed or removed. Use python=<version> to request the installation of a specific version of Python.
Edit: Since the package documentation mentions python instead of "python package" by mistake, I have made a pull request on github to correct this so future versions (or currently the development version) have a clearer explanation. The new text says:
packages
A character vector, indicating package names which should be installed or removed. Use <package>==<version> to request the installation of a specific version of a package.