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

Plotting graphs with several lines rpython2 - additional lines won't show

I have the following simple code that attempts to show three graphs in the same plot. The two last graphs I ask for with the "lines"-function won't show and I am at my wits end. Is this a bug or am I doing something stupid? Workarounds, or ways of…
The Unfun Cat
  • 29,987
  • 31
  • 114
  • 156
0
votes
0 answers

Lost records when using Rpy2 execute r-script and write results to a csv file

I have been having problem of missing records in the output file when using Rpy2 execute r-script and the script has function of writing analysis results to a csv file. Please see below for the source code. For example, I have 785 records in my…
Bigyellowbee
  • 123
  • 1
  • 12
0
votes
2 answers

rpy2/Rmagic: can't read csv data file

I have a pretty standard csv data set that I'm trying to read in IPython Notebook using rpy2/Rmagic: # R code %load_ext rmagic %R my.data <- read.csv("/Users/xxx/Documents/data.csv") I get this…
Randy Olson
  • 3,131
  • 2
  • 26
  • 39
0
votes
1 answer

Calling my own R routines with Python

I want to call a complex algorithm coded in R from python. Looking at the RPY2 package documentation I understand that I can call many standard R functions using the robjects package. I was wondering if this could be extended to my own R routines.…
RockridgeKid
  • 145
  • 3
  • 11
0
votes
4 answers

How to do hold on in Rpy2?

I have plotted a graph using rpy2. I am using Eclipse. When I run the code, the plot just blinks for 1 sec and go away. How do I make the graph to hold on? My code is: #!/usr/bin/python import rpy2.robjects as robjects r = robjects.r r('x = c(1,…
Sam Ad
  • 31
  • 1
  • 5
0
votes
1 answer

How to plot using data in database in Rpy2?

The data are stored in a database called "data" with two coloumns "month" and "traffic". The table looks like this: +-----------+---------+ | month | traffic | +-----------+---------+ | January | 1000 | | February | 100 | | March |…
Sam Ad
  • 31
  • 1
  • 5
0
votes
1 answer

install ry2 on windows 7

This is again a repetition of the same problem, but I was forced to put it as new question. So please donot delete this admins! I am new to R and Rpy2. My problem is similar. I am using p*ython 2.6, R 2.15.1, rpy2 2.2.6, and Windows 7*. R_HOME:…
Avishek Dutta
  • 97
  • 2
  • 11
0
votes
0 answers

R, python: "initial value in 'vmmin' is not finite" error

I'm trying to use R's fitdistr in Python through rpy2: x = MASS.fitdistr(np.asarray(myValues), "beta", start=startParams) But I got this message: Error in optim(x = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, : initial value in 'vmmin'…
Ricky Robinson
  • 21,798
  • 42
  • 129
  • 185
0
votes
1 answer

converting a Python list to an R numeric vector

I need to fit my data into a Beta distribution and retrieve the alpha parameter. I've been coding in Python, but there doesn't seem to be any beta fitting function in SciPy. Either I do everything in Matlab, which I'm not too familiar with, or in…
Ricky Robinson
  • 21,798
  • 42
  • 129
  • 185
0
votes
2 answers

Keyword Error: calling as.geodata function in geoR with rpy2

I am getting SyntaxError: keyword can't be an expression in a script I am working on. I am using rpy2 (and the R package geoR) in Python to work with a data table that is retrieved from a PostgreSQL database using R's database functions. The data…
damian
  • 21
  • 6
0
votes
3 answers

Useful packages to create online prediction tool with Python and R (example provided)

I am building a Cox PH statistical model to predict the probability of relapse for breast cancer patients. I would like to create an online interface for patients or doctors to use that would allow them to input the relevant patient…
vokey588
  • 203
  • 1
  • 3
  • 9
0
votes
1 answer

Slow glm calculation when using rpy2

I want to calculate logistic regression parameters using R's glm package. I'm working with python and using rpy2 for that. For some reason, when I'm running the glm function using R I get much faster results than by using rpy2. Do you know why the…
user5497
  • 243
  • 1
  • 2
  • 10
0
votes
1 answer

RPy2 Convert Dataframe to SpatialGridDataFrame

how can a Dataframe be converted to a SpatialGridDataFrame using the R maptools library? I am new to Rpy2, so this might be a very basic question. The R Code is: coordinates(dataf)=~X+Y In Python: import rpy2 import rpy2.robjects as robjects r =…
0
votes
1 answer

NameError: a global name 'RPyPException' is not defined

2ND question: Thanks so much Ben! It works! I got at Error 13 message saying I couldn't make a temporary file in C:\Program Files so I movd the ARSER folder and put it under my user name. That took care of the Error 13 but now I get NameError: a…
0
votes
1 answer

Indexing of array in rpy2

I just started using Python resp. Rpy2 so I am really a beginner. So far I manage to get my own R-package loaded via Rpy2 and a result for my input variables is produced (comparable to the lm() function of R). My result is a following: >>>…
Johannes
  • 1,024
  • 13
  • 32