RWrapR
Features 
RWrapR is a python package for using R inside of python.
It is built using rpy2, but attempts to be more convient to use.
Ideally you should never have to worry about using R objects,
instead treating R functions as normal python functions, where the inputs
and outputs are python objects.
import rwrapr as wr
import pandas as pd
import numpy as np
dplyr = wr.library("dplyr")
dt = wr.library("datasets")
dplyr.last(x=np.array([1, 2, 3, 4]))
dplyr.last(x=[1, 2, 3, 4])
iris = dt.iris
df = dplyr.mutate(iris, Sepal=wr.Lazily("round(Sepal.Length * 2, 0)"))
To do
1. Better warning handling (this will likely be tricky)
- Sometimes we will get datatypes which are incompatible,
e.g., warning accompanied by
2. Better handling of missing values.
Requirements
Rmust be installed
Installation
You can install RWrapR via pip from PyPI:
pip install rwrapr
Usage
Please see the Reference Guide for details.
Managing R dependencies
RWrapR will automatically install the required R packages, using the
global library path. Sometimes this is not desirable, and you may want to
use the renv package to manage your R dependencies. To do this, you can
use renv via the rwrapr package.
import rwrapr as wr
renv = wr.library("renv") # note you must install renv globally first
renv.init() # initialize renv
renv.install("statisticsnorway/ssb-metodebiblioteket")
renv.install("metodebiblioteket")
renv.snapshot(type="all") # update lock-file
If you are using .ipynb files, you can should add renv.autoload() to the
top of your notebook to ensure that the correct R environment is loaded.
For further details, see the Renv Article
Contributing
Contributions are very welcome. To learn more, see the Contributor Guide.
License
Distributed under the terms of the MIT license, RWrapR is free and open source software.
Issues
If you encounter any problems, please file an issue along with a detailed description.
Credits
This project was generated from Statistics Norway's SSB PyPI Template.
Metadata
Release files for rwrapr 0.9.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rwrapr-0.9.6.tar.gz | 19.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rwrapr-0.9.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.4 kB
Release files / rwrapr-0.9.6.tar.gz
| Download URL | rwrapr-0.9.6.tar.gz |
|---|---|
| Size | 19.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d72db70330bb7e4d4eec4516a579843f9397a3edfa1d3c6c32424b4099550359
|
|
BLAKE2b-256 checksum How to use checksums |
8e5a54c453ff420794676377ff2b648c95e6a5778928201cf17b582fd329c78a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.
Transparency logRelease files / rwrapr-0.9.6-py3-none-any.whl
| Download URL | rwrapr-0.9.6-py3-none-any.whl |
|---|---|
| Size | 23.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c35c1e72c3477b0a33d984254a4781e91a704462c13316c888921a16b6cf7d7
|
|
BLAKE2b-256 checksum How to use checksums |
94d07fdf09c6b7e798f9a6e7804a804b164865bbb77cbcb7b771af5b41857c67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.
Transparency log