Skip to main content

Python -> R bridge

pypi Codecov GH Actions

PyPI - Downloads Conda Downloads

The project's webpage is here: https://rpy2.github.io/

Installation

Released versions can be installed from a package repository (default being pypi) using pip:

pip install rpy2

The package has optional depencies providing specific functionalities not otherwise required to use the rest of rpy2.

For example, to be able to run the unit tests:

pip install 'rpy2[test]'

To install all optional dependencies (numpy, pandas, ipython), use:

pip install 'rpy2[all]'

Installation for rpy2 developers

If a developer, the package can be installed from its source tree. rpy2 is a namespace package with its consituting parts in different "sub-packages".

To install from the source tree, just enter:

pip install ./rpy2-rinterface/ ./rpy2-robjects/ .

Various optional dependencies can be specified through dependency groups. For example:

pip install ./rpy2-rinterface'[all]' ./rpy2-robjects'[all]' '.[all]'

rpy2-rinterface contains the binding to R's C API. Building from source require a compilation toolchain / developper tools installed, and you will have to figure out how to have them installed on your system by yourself. The CI pipeline builds binary wheels for Linux, MacOS, and Windows. Watching how things are set up there is pretty much all documentation from the package maintainers on the matter.

Issues loading shared C libraries

Whenever R is in not installed in a system location, the system might not know where to find the R shared library.

If R is in the PATH, that is entering R on the command line successfully starts an R terminal, but rpy2 does not work because of missing C libraries, try the following before starting Python:

export LD_LIBRARY_PATH="$(python -m rpy2.situation LD_LIBRARY_PATH)":${LD_LIBRARY_PATH}

Documentation

Documentation is available either in the source tree (doc/), or online.

Testing

rpy2 uses pytest, with the plugin pytest-cov for code coverage. To test the package from the source tree, either to check and installation on your system or before submitting a pull request, do:

pytest rpy2-rinterface/ rpy2-robjects/

For code coverage, do:

pytest --cov=rpy2.rinterface_lib \
       --cov=rpy2.rinterface \
       --cov=rpy2.ipython \
       --cov=rpy2.robject \
       rpy2-rinterface/ rpy2-robjects/

For more options, such as how to run specify tests, please refer to the pytest documentation.

License

RPy2 can be used under the terms of the GNU General Public License Version 2 or later (see the file gpl-2.0.txt). This is the very same license R itself is released under.

Metadata

Release files for rpy2 3.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rpy2 3.6.0
File Size Uploaded Provenance Actions
rpy2-3.6.0.tar.gz 52.6 kB Without provenance Details for rpy2-3.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rpy2 3.6.0
File Interpreter ABI Platform Actions
rpy2-3.6.0-py3-none-any.whl Python 3 none any Details for rpy2-3.6.0-py3-none-any.whl

Total release size: 62.5 kB

Release files / rpy2-3.6.0.tar.gz

Download URL rpy2-3.6.0.tar.gz
Size 52.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8f427b7ca3c40e91d1bc2377ae92a1d48cf5c422a2d5afe97cb0782bb807178c
BLAKE2b-256 checksum
How to use checksums
09a52a577cb8263e0a73cc152f6170ffc99a0cc7f02028edb0e794e9071fb61e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release files / rpy2-3.6.0-py3-none-any.whl

Download URL rpy2-3.6.0-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
753322ece2d52ba1fce56dd2977feb2c672ad5ea9db61b66aea9f373aaee7dab
BLAKE2b-256 checksum
How to use checksums
e09b8407b9bc194393fb2665d0324b9c8921b1f704977da43dd9e0bfa36f4e3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Security for rpy2 3.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.6.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page