Skip to main content

Mapping R API to Python

Project description

Interoperate R with Python

Build Status CircleCI Build status codecov pypi

Installation

# install released version
pip install -U rchitect

# or the development version
pip install -U git+https://github.com/randy3k/rchitect

Why?

Why writing another package when there is rpy2?

The main reason is to drive radian. rpy2 was not suitable because it is missing some key features for running the R REPL. Speaking of compatibility, rchitect has been thoroughly tested on multiple platforms such as Windows, macOS and Linux and we also provide binary wheels for user convenience.

Getting started

from rchitect import *
a = reval("1:5")     # evaluate an R expression in the global environment
b = rcopy(a)         # convert any RObject returned by `reval` to its python type
c = robject(b)       # convert any python object to its R type
d = rcall("sum", c)  # call an R function. Python objects are converted to RObjects implicitly.

FAQ

Sometimes, rchitect may fail to open the R shared library. User could first try to expose the path to R to the PATH vaiable. In Linux/macOS, one could also specify R_HOME explictly:

export R_HOME=/usr/local/lib/R

Note that it should be the path to R_HOME, not the path to the R binary. In Linux, you may need to futher specify LD_LIBRARY_PATH,

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`R RHOME`/lib"

Wiki

reticulate conversions

Project details


Download files

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

Files for rchitect, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size rchitect-0.3.0-cp27-cp27m-macosx_10_6_intel.whl (109.5 kB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp27-cp27m-manylinux1_i686.whl (105.8 kB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp27-cp27m-manylinux1_x86_64.whl (110.6 kB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp27-cp27mu-manylinux1_i686.whl (105.8 kB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp27-cp27mu-manylinux1_x86_64.whl (110.6 kB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp27-cp27m-win32.whl (41.7 kB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp27-cp27m-win_amd64.whl (42.0 kB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp34-cp34m-macosx_10_6_intel.whl (109.6 kB) File type Wheel Python version cp34 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp34-cp34m-manylinux1_i686.whl (102.7 kB) File type Wheel Python version cp34 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp34-cp34m-manylinux1_x86_64.whl (107.3 kB) File type Wheel Python version cp34 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp34-cp34m-win32.whl (41.8 kB) File type Wheel Python version cp34 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp34-cp34m-win_amd64.whl (41.9 kB) File type Wheel Python version cp34 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp35-cp35m-macosx_10_6_intel.whl (109.6 kB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp35-cp35m-manylinux1_i686.whl (102.7 kB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp35-cp35m-manylinux1_x86_64.whl (107.3 kB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp35-cp35m-win32.whl (43.9 kB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp35-cp35m-win_amd64.whl (45.4 kB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp36-cp36m-macosx_10_6_intel.whl (109.6 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp36-cp36m-manylinux1_i686.whl (102.7 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp36-cp36m-manylinux1_x86_64.whl (107.3 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp36-cp36m-win32.whl (43.9 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp36-cp36m-win_amd64.whl (45.4 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp37-cp37m-macosx_10_6_intel.whl (109.6 kB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp37-cp37m-manylinux1_i686.whl (102.8 kB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp37-cp37m-manylinux1_x86_64.whl (107.2 kB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp37-cp37m-win32.whl (43.9 kB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size rchitect-0.3.0-cp37-cp37m-win_amd64.whl (45.4 kB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size rchitect-0.3.0.tar.gz (20.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page