Tag Archives: rpy2

R warnings when starting rpy2 and installation

On Fedora 15 When I start rpy2 using this command import rpy2 from rpy2 import robjectsimport rpy2 from rpy2 import robjects I was getting these annoying warnings, which do not appear when starting a pure R session: During startup – … Continue reading

Posted in Computer Science | Tagged , | 4 Comments

Upgrading R and rpy2

When upgrading R version, you must recompile rpy2. Let us take a case study based on the upgrade of R2.15 to R2.15.1. First, you need to download the source from the main page http://www.r-project.org/ Once downloaded, get the source tar … Continue reading

Posted in Computer Science | Tagged , | Leave a comment

How to call R plotting function from python using rpy2

Python has already very good librairies from plotting (e.g., matplotlib, mayavi), however, it is sometimes useful to use some of the plotting functionalities offered by R. Thanks to the rp2 package, it is quite easy. Let us try to use … Continue reading

Posted in Python | Tagged , , | Leave a comment

installing rpy2 with different R version already installed

The easiest way to install a python package is to use easy_install (or pip), so to install rpy2, type: easy_install rpy2 To test that it is properly installed, type: import rpy2; from rpy2 import robjects; robjects.r(“version”) If this code works, … Continue reading

Posted in Computer Science, Linux, Python | Tagged , , , , | 8 Comments

RPy2 substitute function does not work

I’m using rpy2 to call R package from Python, which works pretty well most of the time. Yet, I’ve encountered an issue with the R function called substitute that do not behave as expected when called from rpy2. Consider the … Continue reading

Posted in Computer Science | Tagged , | Leave a comment

Fitting distribution by combing R and Python

The following example illustrates how to use R package with Python by using the Rpy2 package. This problem solve in this example is to fit a normal distribution on some data samples.   from rpy2.robjects import r from rpy2.robjects.packages import … Continue reading

Posted in Python | Tagged , , | Leave a comment