Posts Python and R
Post
Cancel

Python and R

Tools

R Interface to Python

I found reticulate to be a pretty good tool. The following notes are for this tool. And the following implementations are in RStudio(R in terminal also works).

References:

Import a python module

Full path of python should be used in the use_python function. To find the path, use which python in the terminal.

1
2
3
library(reticulate)
use_python('/Users/yuyang/anaconda3/bin/python', required = TRUE)
pd <- import("pandas")

Python Interface to R

Updated Feb 23, 2020 2020-02-23T15:14:05-06:00
This post is licensed under CC BY 4.0