Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As pointed out by @lgautier, there is already <a href="https://stackoverflow.com/q/5630441/1290420">another answer on this subject</a>. I leave my answer here as it adds the experience of approaching R as a novice, knowing Python first.</p> <hr> <p>I use both Python and R and sympathise with your need as a newcomer to R. </p> <p>Since any answer you get will be subjective, I summarise a few points from my experience:</p> <ul> <li>I use <a href="http://rpy.sourceforge.net/rpy2.html" rel="noreferrer">rpy2</a> as my interface and find it is 'Pythonic', stable, predictable, and effective enough for my needs. I have not used the other packages so this is not a comment on them, rather on the merits of rpy2 itself.</li> <li>BUT do not expect that there will be an easy way of using R in Python without learning both. I find that adding an interface between the two languages allows ease of coding when you know both, but a nightmare of debugging for someone who is deficient in one of the languages.</li> </ul> <p>My advice:</p> <ol> <li>For most applications, Python has packages that allow you to do most of the things that you want to do in R, from data wrangling to plotting. Check out <a href="http://www.scipy.org/" rel="noreferrer">SciPy</a>, <a href="http://www.numpy.org/" rel="noreferrer">NumPy</a>, <a href="http://pandas.pydata.org/" rel="noreferrer">pandas</a>, <a href="http://biopython.org/wiki/Biopython" rel="noreferrer">BioPython</a>, <a href="http://matplotlib.sourceforge.net/" rel="noreferrer">matplotlib</a> and other scientific packages, or even the full <a href="https://store.continuum.io/cshop/anaconda/" rel="noreferrer">Anaconda</a> or <a href="http://www.enthought.com/products/epd.php" rel="noreferrer">Enthought</a> python distributions. This allows you to stay within the Python environment and provides you most of the power that you need.</li> <li>At the same time, you will want R's vast range of specialised packages, so spend some time learning it in an interactive environment. I found it almost impossible to master even basic R on the command line, but <a href="http://rstudio.org/" rel="noreferrer">RStudio</a> and the tutorials at <a href="http://www.statmethods.net/" rel="noreferrer">Quick-R</a> and <a href="http://learnr.wordpress.com/" rel="noreferrer">Learn-R</a> got me going very fast.</li> </ol> <p>Once you know both, then you will do magic with <a href="http://rpy.sourceforge.net/rpy2.html" rel="noreferrer">rpy2</a> without the horrors of cross-language debugging.</p> <hr> <h2>New Resources</h2> <p><strong>Update on 29 Jan 2015</strong></p> <p>This answer has proved popular and so I thought it would be useful to point out two more recent resources:</p> <ul> <li>Ralph Heinkel gave a great talk on this subject at EuroPython 2014. The video on <a href="https://www.youtube.com/watch?v=ucJ2-5a2CAA" rel="noreferrer"><em>Combining the powerful worlds of Python and R</em></a> is available on the <a href="https://www.youtube.com/channel/UCadZ6_NWdCN6YolgQdfV8Pg" rel="noreferrer">EuroPython YouTube channel</a>. Quoting him:</li> </ul> <blockquote> <p>The triplet <a href="http://www.r-project.org" rel="noreferrer" title="R">R</a>, <a href="https://rforge.net/Rserve/" rel="noreferrer" title="Rserve">Rserve</a>, and <a href="https://pypi.python.org/pypi/pyRserve/" rel="noreferrer" title="pyRserve">pyRserve</a> allows the building up of a network bridge from Python to R: Now R-functions can be called from Python as if they were implemented in Python, and even complete R scripts can be executed through this connection.</p> </blockquote> <ul> <li>It is now possible to combine R and Python using <a href="http://rpy.sourceforge.net/rpy2/doc-2.4/html/interactive.html#module-rpy2.ipython.rmagic" rel="noreferrer"><code>rmagic</code> in <code>IPython/Jupyter</code></a> greatly easing the work of producing reproducible research and notebooks that combine both languages.</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload