Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I import python packages using knit r?

Tags:

r

knitr

I am looking to integrate python code into a r notebook (or even a rmarkdown document). I am able to run Python using a python code chunk:

```{python} 

```

However I am unable to import a package (e.g. pandas). I have anaconda installed which has pandas installed, however I am unable to import it. Can anyone give me direction as to how I can import packages into r via knitr, preferably using anaconda?

like image 721
R_user1233 Avatar asked Nov 08 '22 06:11

R_user1233


1 Answers

{python, engine.path="/path/to/your/anaconda3/bin/python"}
like image 74
PhilChang Avatar answered Nov 15 '22 06:11

PhilChang