Run python scripts (classes and methods) in "R"
2
0
Entering edit mode
8.8 years ago
ahmedakhokhar ▴ 150

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

python r • 4.2k views
ADD COMMENT
3
Entering edit mode
  1. Egads why?
  2. Are you sure this is a bioinformatics question...
ADD REPLY
0
Entering edit mode

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 REPLY
1
Entering edit mode
8.8 years ago

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 COMMENT
0
Entering edit mode
8.8 years ago

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 COMMENT
1
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 2162 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6