skillfed

rpy2-robjects

Python interface to the R language (embedded R)

rpy2-robjects v3.6.5 120.6K downloads/30d#12,018 on PyPI702
Copyleft license GPLv2+ Active released

What it is and what it does

rpy2-robjects is the object-oriented layer of the rpy2 Python-to-R bridge, built on top of rpy2-rinterface. It allows Python code to call R functions, manipulate R objects, and work with R data structures as if they were native Python objects. The package depends on rpy2-rinterface, jinja2, tzlocal, and packaging.

Typical use involves importing R functions or running R code snippets from within Python scripts, making it useful for data analysis workflows that combine Python and R. The package supports Python 3.9, 3.10, 3.11, 3.12, and 3.13, and is actively maintained. Installation is straightforward via pip, though it requires a working R installation on the system and may need library path configuration if R is not in a standard location.

Use it for:

  • Call R statistical functions and packages from Python without leaving your Python environment.
  • Combine Python data processing with R's statistical modeling and visualization capabilities.
  • Prototype or migrate R code to Python incrementally by running R functions directly.
  • Access R objects and data structures in Python for further manipulation or integration.
  • Build Python applications that leverage specialized R packages not available in Python.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a Python interface to call R code and access R objects directly from Python, enabling interoperability between the two languages.

Yes, if you need to call R from Python and have R already installed on your system. The package is actively maintained, has low install friction, and carries no known vulnerabilities. The GPLv2+ copyleft license requires careful consideration if you plan to distribute your code—ensure your project's license is compatible. The main blocker is the external R dependency and potential library path configuration on non-standard R installations.

Install

rpy2-robjects on PyPI

pip

pip install rpy2-robjects

uv

uv add rpy2-robjects

poetry

poetry add rpy2-robjects

Installing rpy2-robjects

Before you install

Low install friction with a pure-wheel distribution. Actively maintained with recent commits and releases. Requires R to be installed and accessible on the system; if R is not in a standard location, library path configuration may be needed.

License in practice

Released under GPLv2+, a copyleft license. Any code that links or distributes this package must comply with GPL terms, including potential source code disclosure obligations.

Quickstart

pip install rpy2-robjects

from rpy2.robjects import r
result = r('sum')

R must be installed and accessible on the system; if R is not in a standard location, LD_LIBRARY_PATH may need to be configured before importing.

Verify before relying

  • Whether rpy2-robjects works as a standalone package or requires the parent rpy2 package to be installed separately.
  • Performance characteristics and overhead when calling R functions from Python in tight loops.
  • Compatibility with specific R versions and whether version mismatches cause runtime failures.

Package facts

License GPLv2+ (copyleft)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 4 — rpy2-rinterface, jinja2, tzlocal, packaging
Maintenance actively maintained — 140 days since the last release
Last repo commit
First released
Downloads 120,582/month — #12,018 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: rpy2_robjects-3.6.5-py3-none-any.whl

Intended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)Programming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

python r integrationcall r from pythonr language bridgeembedded r interpreterpython r interop
r-integrationdata-sciencelanguage-bridge

More Scientific/Engineering packages