Skip to content
Prev 2146 / 12125 Next

[R-pkg-devel] adding rPython as a suggested package

Hi:

Just a comment tangentially related to this topic:  There are a number of R
packages for calling Python from R, including the "rPython" and
"reticulate" packages mentioned in this thread.  Another is "PythonInR".  (
https://cran.r-project.org/web/packages/PythonInR/index.html).  These
packages address the problem of invoking a Python module or package which
is installed on the user's machine.  I.e., they answer the question, "How
can I access from R a suite of useful Python tools I have configured in my
workspace?"  There is a complementary question, "How can I expose in an R
package specific functionality written in Python?"  In the latter case the
Python function is written specifically for the R package and the R package
should be *isolated* from any installed Python environment.  The package
should not change any installed Python environment and anything you do in
Python should not affect how the R package executes.

We have addressed this second problem with a package PythonEmbedInR (
https://github.com/Sage-Bionetworks/PythonEmbedInR).  This is a
modification of PythonInR which *embeds* a hidden/private copy of Python 3
within the R package, totally isolated from any other Python runtime
concurrently installed on the machine.  Further it works *cross platform*
(Linux, Windows and MacOS).  We build the package binaries and host them
using Github pages, so to install you simply add to your list of CRAN
repo's, "https://sage-bionetworks.github.io/ran". You need not build from
source to use the package on Windows or Mac.  This is significant because
building the package also builds the Python runtime.

Any questions, please ask.

Bruce Hoff
Sage Bionetworks


2017-12-01 7:50 GMT+01:00 Slava Lyubchich <lyubchich at umces.edu>:
rPython is not available for Windows. You can see "OS_type: unix" in
its DESCRIPTION. If you want to support Windows systems, take a look
at the reticulate package, which is another R interface to Python.
Create an inst/ directory and put it there, as suggested in "1.1.7
Non-R scripts in packages" in the "Writing R Extensions" manual.

I?aki