Change the future

rpy2: Use R from the Comfort of Python

Laurent Gautier

Audience level:
Big Data


R has become hard to avoid when working with data; there is hardly a method in statistics or visualization that is not available, and there are many methods that are originally only available in R.

The Python-to-R bridge opens the whole library of R functions, classes, and datasets to the Python programmer by exposing an embedded R process and its objects through a Python library.


The R language has quickly become a major player in data analysis, statistics, and visualization. It can be an enormous advantage to have access to its enormous collection of existing libraries or to be able to constitute polyglots development teams with data scientist working with software developers while keeping their primary data language.

The rpy2 Python-to-R bridge embeds R an process in Python and expose all of R as Python objects: existing R functions or data structures can be used like a Python library, or R can be used an a domain-specific language within Python.

The presentation is briefly presenting the internals of the bridge and is demonstrating its ease-of-use by showing how a Python-only client can communicate with R on a remote server also implemented in Python.