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
1 answer

How to set geom_point fill for ggplot in rpy2 from Python?

I'm making the following simple plot with ggplot using rpy2: from rpy2.robjects.lib import ggplot2 from rpy2.robjects import r, Formula # R iris dataset iris = r('iris') p = ggplot2.ggplot(iris) + \ …
user248237
0
votes
1 answer

How to plot a scatter diagram using rpy2 in python?

I have a dataset like below in dictionary format, data={'a': [10, 11,12,5,4,3,1], 'b': [7, 18,5,11,9,2,0]} How we can make a scatter plot in python using rpy2? where x axis is the months and y axis are the mutiples of 5? we need to plot the graph…
user2286041
  • 43
  • 1
  • 7
0
votes
2 answers

Difference of two IntVectors in Rpy

a and b are both rpy2 IntVectors: [ 81, NA_integer_, NA_integer_, ..., 120, 46, NA_integer_] How can I calculate the b - a difference? I want the result as an IntVector.
winerd
  • 1,813
  • 1
  • 14
  • 12
0
votes
1 answer

Plotting greek letters and plain text in ggplot2 graphs via Rpy2

How can I make an x or y label like "$\alpha$ + $\beta$ is my label" in a ggplot2 plot within Rpy2? I've tried getting any greek letter on the plot using r.expression: p = ggplot2.ggplot(mydata) + r.xlab(r.expression("alpha")) but this does not…
user248237
0
votes
1 answer

Getting Error installing rpy2 on Windows7

Error: Tried to guess R's HOME but no R command in the PATH. I did exactly this: 3. Define environmental variables Control Panel | Advanced tab | Environmental Variables define the following: RHOME, R_HOME, R_USER examples `RHOME: C:\Program…
user21988
  • 67
  • 1
  • 9
0
votes
0 answers

Converting pandas panel object to rpy2.robjects.vectors.Array object

Is there a function to convert pandas panel (3-dimensional) object to a rpy2.Array object? I was able to do this to convert only the data to rpy2.Array. But this doesnt set the dimnames/names for the array object. arrayobj =…
0
votes
1 answer

rpy2 module not working in Python3.2

I am trying to import the rpy2 (version2.3.4) library into Python (version3.2.3) on a Ubuntu 12.10 machine. The rpy2 documentation says that rpy2 works under all Python 3 versions and I am also finding other topics related to rpy2 and Python3.2…
Cutú Chiqueño
  • 855
  • 1
  • 10
  • 24
0
votes
1 answer

model as r function's parameter, when calling the r function using rpy2 from multithreads

This is more of a efficiency problem when calling r functions using rpy2 from multithreads. The task of the r functions basically load a model file from disk and use the model to classify time series. However collecting the input time series is done…
appletwo
  • 1,128
  • 1
  • 8
  • 6
0
votes
1 answer

geom_dotplot in rpy2?

When I try to use gplot2.geom_dotplot I get the error: AttributeError: 'module' object has no attribute 'geom_dotplot' Does this function have a different name in Rpy2? thanks.
user248237
0
votes
3 answers

rpy2 object not found error

I am trying to use rpy2 to let me use some r functionality in python. Here is a simple regression I want to do. I create a data frame, convert it to R data frame and then try using R's lm. But the R data frame cannot be found (see below). Where…
user2133151
  • 247
  • 1
  • 2
  • 10
0
votes
2 answers

Using log axes scales in ggplot from Rpy2

I am trying to format my axes on a log scale from Rpy2 using ggplot. In ordinary R, it's possible to do: qplot(data=data, x=x, y=y) + geom_point() + scale_y_log2() To get a log2 axis. When I try to use ggplot2.scale_y_log2 in Rpy2, it complains…
user248237
0
votes
1 answer

How to install Rpy2 for Python 2.6 on WINDOWS XP

I download the rpy2-2.2.3 , and try to : python setup.py install on my windows xp computer with R: 2.12.2 , Python: 2.6.1 , after copying some files, it shows below error msg. How to fix ? Traceback (most recent call last): File "setup.py", line…
bigbug
  • 55,954
  • 42
  • 77
  • 96
0
votes
1 answer

adding legend when plotting with rpy2

I am trying to plot an ECDF by using the following commands But when I run the script I get this error 1: In rect(left, top, r, b, angle = angle, density = density, ...) : supplied color is not numeric nor character 2: In rect(left, top, r, b,…
anle
  • 93
  • 7
0
votes
1 answer

Unable to use Rpy2

Why I try to load Rpy2 in Python, the interpreter finds the module but as soon as I try to import anything from it, it returns an error: e.g. import rpy2 # No errors, although it does not print anything But import rpy2.robjects returns the…
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
0
votes
1 answer

Extract list element by name in rpy2?

I'm not able to find a way to extract list element by name after reading the manual and searching stackoverflow. What I end up with is the following way to extract the p.value. But it is better to extract the element by the name 'p.value' so that…
user1424739
  • 11,937
  • 17
  • 63
  • 152