Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rchitect

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rchitect

Mapping R API to Python

  • 0.4.7
  • PyPI
  • Socket score

Maintainers
1

Interoperate R with Python

Main codecov pypi Conda version

Installation

# install released version
pip install -U rchitect

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

Why reinvent the wheel?

You may be curious why I reinvented the wheel 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 python 3.6+.

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

How to switch to a different R or specify the version of R.

There are a few options.

  • One could expose the path to the R binary in the PATH variable
  • The environment variable R_BINARY could also be used to specify the path to R.
  • The environment variable R_HOME could also be used to specify R home directory. Note that it is should be set as the result of R.home(), not the directory where R is located. For example, in Unix
$ env R_HOME=/usr/local/lib/R radian
Cannot find shared library

Please also make sure that R was installed with the R shared library libR.so or libR.dylib or libR.dll. On Linux, the flag --enable-R-shlib may be needed to install R from the source.

Wiki

reticulate conversions

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc