# install released version pip install -U rchitect # or the development version pip install -U git+https://github.com/randy3k/rchitect
You may be curious why I reinvented the wheel when there is
The main reason is to drive
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 2.7 and 3.5+.
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.
There are a few options.
R_BINARYcould also be used to specify the path to R.
R_HOMEcould 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
Ris located. For example, in Unix
$ env R_HOME=/usr/local/lib/R radian
Please also make sure that R was installed with the R shared library
libR.dll. On Linux, the flag
--enable-R-shlib may be needed to install R from the source.