Skip to main content

Python package for using R in Python

Project description

RWrapR

PyPI Status Python Version License

Documentation Tests Coverage Quality Gate Status

pre-commit Black Ruff Poetry

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. Port all test files for SSB-GaussSuppression, and SSBtools
2. Names/Dimnames for Vectors/Arrays/Matrices
3. Factors/Ordered Vectors
4. Better warning handling (this will likely be tricky)
    - Sometimes we will get datatypes which are incompatible,
        e.g., warning accompanied by
5. Better handling of missing values.
6. renv.script() for creating r scripts

Requirements

  • TODO

Installation

You can install RWrapR via pip from PyPI:

pip install rwrapr

Usage

Please see the Reference Guide for details.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rwrapr-0.9.0.tar.gz (24.5 kB view details)

Uploaded Source

Built Distribution

rwrapr-0.9.0-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

Details for the file rwrapr-0.9.0.tar.gz.

File metadata

  • Download URL: rwrapr-0.9.0.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for rwrapr-0.9.0.tar.gz
Algorithm Hash digest
SHA256 552c42ee2a6b37112f08519d1cdd95d108f41acf13d662e5f4bc1ed85a8db731
MD5 675b1808bdc0f552805c6fbbdc9f2368
BLAKE2b-256 615117c277310796e6b1d6f52980a8fdbfb82ae4b0ffe4ca13226a01f7ef99b1

See more details on using hashes here.

File details

Details for the file rwrapr-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: rwrapr-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 28.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for rwrapr-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 edfe3a98a6018cacd87bfbfd812561fc08a88b9eb65c62b63ca18fcbb6c80502
MD5 e61ef4b307d1ff9bc89fcc8b45397fb1
BLAKE2b-256 7641cda41062cddaf97244c84488a8edc37b4c4d5ec27edfca365167c1c22f23

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page