Question: Run python scripts (classes and methods) in "R"
0
gravatar for ahmedakhokhar
3.1 years ago by
ahmedakhokhar110
Belgium
ahmedakhokhar110 wrote:

I am new to R and need suggestion:

I want to run python scripts (classes and methods) in "R", someone please suggest

R packages (other then rPython) with full documentation to perform this task,

smoothly and reliably. Thanks

R python • 2.9k views
ADD COMMENTlink modified 3.1 years ago by Matt Shirley8.9k • written 3.1 years ago by ahmedakhokhar110
3
  1. Egads why?
  2. Are you sure this is a bioinformatics question...
ADD REPLYlink written 3.1 years ago by Devon Ryan88k

Should not this question be closed as it is remotely not associated with Bioinformatics or any packages that might be used for any bioinformatics task. I am sure it is an important technical question and one should address the query but there are other technical forums like stackoverflow (http://stackoverflow.com/) or python mailing lists (https://www.python.org/community/lists/) or even quora (https://www.quora.com/) that might guide much better way and we stick to the guidelines of the forum.

ADD REPLYlink written 3.1 years ago by ivivek_ngs4.7k
1
gravatar for Istvan Albert
3.1 years ago by
Istvan Albert ♦♦ 79k
University Park, USA
Istvan Albert ♦♦ 79k wrote:

You may be able to run R in Python but I don't think you can run Python in R.

Also if you are new to R then focus on learning R rather than trying to embed Python. That will just confuse you even more.

ADD COMMENTlink written 3.1 years ago by Istvan Albert ♦♦ 79k
0
gravatar for Matt Shirley
3.1 years ago by
Matt Shirley8.9k
Cambridge, MA
Matt Shirley8.9k wrote:

I don't think you're going to get a reliable package to call Python code and return R objects (which is what it sounds like you want). While technically embedding python in other languages can be done through conversion to C data structures and back, I think no one really wants to do this. Your best bet is to learn how to make system calls using R, and calling your python script directly - then capturing the return data from the script on stderr or stdout using the system2 function.

ADD COMMENTlink written 3.1 years ago by Matt Shirley8.9k
1

Though on a second thought it would be really nice to use python inside R ;-)

ADD REPLYlink written 3.1 years ago by Istvan Albert ♦♦ 79k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1256 users visited in the last hour