Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you install a Python package via R - Reticulate

I am about to create a python interface in R with the package Reticulate. In order to access the python functions in R, the respective python packages need to be installed.

Two questions came to my mind:

1) If you use the reticulate package, does the Anaconda package need to be installed? Or is it sufficient to install the python packages only?

2) Is it possible to install python packages in R, similar to install.packages("r_package")?

Does anyone have experience with this Topic? Thanks in advance!

like image 330
Carmen Avatar asked Jun 15 '17 12:06

Carmen


1 Answers

I'll add a little bit of nuance to the previous answer.

Like @f0nzie said, Anaconda is not a package, but a package manager. Ideally, you will create an environment using Anaconda to assist with your package management and version control. The documentation for conda environments is here.

Now, you can install python packages to your anaconda package in R. That is possible using reticulate::conda_install(envname, packages). The documentation for conda_install() can be found here.

like image 71
Dale Jacques Avatar answered Sep 23 '22 10:09

Dale Jacques