Questions tagged [rpy2]

RPy is a very simple, yet robust, Python interface to the R Programming Language. It can manage all kinds of R objects and can execute arbitrary R functions (including the graphic functions). All errors from the R language are converted to Python exceptions. Any module installed for the R system can be used from within Python

RPy is a very simple, yet robust, Python interface to the R Programming Language. It can manage all kinds of R objects and can execute arbitrary R functions (including the graphic functions). All errors from the R language are converted to Python exceptions. Any module installed for the R system can be used from within Python.

rpy2 is a redesign and rewrite of rpy. It is providing a low-level interface to R, a proposed high-level interface, including wrappers to graphical libraries, as well as R-like structures and functions.

https://rpy2.bitbucket.io

1203 questions
0
votes
0 answers

ipython R : X11 module cannot be loaded

Initially I had a rpy2 related issue but after solving that now I am getting following error when I use R within ipython cell: %%R plot(7) Error in dev.off() : cannot shut down device 1 (the null device) In addition: Warning…
add-semi-colons
  • 18,094
  • 55
  • 145
  • 232
0
votes
0 answers

Function for generating LaTeX tables from R summaries (using RPy)

I am trying to obtain a latex table with the summary of a lme4.lmer() run. There are a number of R packages which claim to do this. However, in my experience none of them could. Here is a run-down: xtable - doesn't seem to take my input, neither…
TheChymera
  • 17,004
  • 14
  • 56
  • 86
0
votes
1 answer

Error installing RPy2-2.3.8 on Windows 7, Python 3.3

guys. I'am trying to installing RPy2-2.3.8 on Windows 7 (64bit), Python 3.3, but RPy2 seems to have quite a lot of installation problems...:( I tried to install RPy2 by typing "python.exe setup.py install" on "cmd" on windows environment. R version…
0
votes
1 answer

Save rpy2.robjects.lib.ggplot2

This gives me a plot and displays in on IPython: from rpy2.robjects import pandas2ri pandas2ri.activate() from rpy2.robjects.lib import ggplot2 from rpy2.interactive import ipython from pandas import DataFrame dataf =…
dmvianna
  • 15,088
  • 18
  • 77
  • 106
0
votes
1 answer

Preloading for Importr in Django

Is there a way to preload libraries for the R instance that rpy2 talks to? I am spending 25-30% of my response time (about .5s per chart) in importr calls to lattice or grdevices, and would like to cut down if possible. Code snippet: grdevices =…
bwarren2
  • 1,347
  • 1
  • 18
  • 36
0
votes
1 answer

How to stop embedded R process in rpy2 using python/ipython

I am using rpy2 to execute R from ipython. However I want to kill or stop the embedded R process but Ctrl-C is not working. This is maybe because ipython intercepts SIGINT (I am not sure).. I tested with SIGSTOP (Ctrl+Z) and it works.. Any method to…
gc5
  • 9,468
  • 24
  • 90
  • 151
0
votes
1 answer

customizing strip of grids in ggplot2 in rpy2

I'm trying to change the background colors of strips on top of facet grids/facet wraps in ggplot2 and also remove their bounding boxes (i.e. just show the labels). It seems that this require element_rect which is not defined in rpy2 -- how can its…
user248237
0
votes
1 answer

how can theme_classic be accessed in rpy2 from ggplot2?

How can theme_classic be accessed from rpy2 in Python? I.e. this: http://www.inside-r.org/packages/cran/ggplot2/docs/theme_classic Is there a way to use it from rpy2?
user248237
0
votes
1 answer

access DataFrame imported with FileChooser

I would import a csv file into python with FileChooser. Then when using rpy2, I can perform Statistical analyses with R I know much better compared to Python. Below is a piece of my code: import pygtk pygtk.require("2.0") import gtk from…
Gaston Cissé
  • 25
  • 1
  • 7
0
votes
1 answer

How to get a normalized fractional count in ggplot2 via rpy2 in Python?

I'd like to make a density plot in rpy2 (using ggplot2) that has y-values representing fractional counts, such that the y axis can be interpreted as "fraction of data points" that have a particular value. My code is: df =…
user248237
0
votes
1 answer

Correlation structure corAR1() "not defined" in rpy2 generalised least squares model gls

I'm using the rpy2 module in python to calculate regressions between two timeseries (ts1 and ts2). The residuals are autocorrelated, so I need to use the gls model rather than lm. I should be able to set my correlation structure as corAR1() as in…
0
votes
1 answer

rpy2 complaining with undefined symbol: Rf_translateCharUTF8

I built R and rpy2 following the steps here, and when I test import rpy2.tests I get the following error: /path/to/python2.7/site-packages/rpy2/rinterface/_rinterface.so: undefined symbol: Rf_translateCharUTF8 in an exception thrown by…
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
0
votes
1 answer

RPy2, subset data frame with multiple conditions

I have a data frame with, amongst others, 2 columns called data_type and input_type. To obtain the subset of the data frame where data_type column has a certain value I can use: subset_frame = dataframe.rx(dataframe.rx2('input_type').ro == 'VALUE',…
Stuart Lacy
  • 1,963
  • 2
  • 18
  • 30
0
votes
1 answer

convert list in Python to vector in R

I already referenced the post here. converting a Python list to an R numeric vector I got the same error, but the provided solution does not work for me, so I am posting it. I am using python 2.7 and rpy2 corresponding newest version in Linux I…
Jin
  • 1,203
  • 4
  • 20
  • 44
0
votes
1 answer

R_user not defined , rpy2

I want to use R from django app .Now I am in a huge mess . --> I have installed rpy2 for that . ---> I am able to run everything from Python IDE eg . import rpy2.rinterface as rinterface rinterface.initr() or import rpy2.robjects as…
gizmo17
  • 31
  • 8