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

Installing rpy2 on windows

I am trying to install rpy2 on a machine running Windows 10. I have already installed R 3.4.4 (64bit) and it works fine in RGui. I then tried to pip install rpy2, but was getting an error that it couldn't find R, so I added c:\Program…
pyguy
  • 99
  • 1
  • 6
4
votes
2 answers

unsigned integer error while trying to convert pandas dataframe to R's dataframe using rpy2

I have the below data : grp_m1 grp_m2 grp_m3 grp_m4 $50-$75 $50-$75 $50-$75 $50-$75 $50-$75 $50-$75 $50-$75 $50-$75 $150-$175 $150-$175 $150-$175 $150-$175 $100-$125 $100-$125 …
Shuvayan Das
  • 1,198
  • 3
  • 20
  • 40
4
votes
2 answers

error installing rpy2 on Mac

I am trying to install rpy2 on python 2.7.14, on a Mac OS High Sierra version 10.13.2, but when I try writing the command pip install rpy2 I get the following output: Collecting rpy2 Using cached rpy2-2.9.2.tar.gz Complete output from command…
AngryR11
  • 93
  • 1
  • 6
4
votes
1 answer

rpy2 installation on Ubuntu

I'm pretty new to Linux and I'm having some serious trouble installing Rpy2. I had an older versions of Rpy2 installed by the synaptic package manager, but I needed an updated version and removed it (all files in the Rpy2 directory as described in…
LasMar
  • 41
  • 1
  • 2
4
votes
1 answer

rpy2: how to suppress R output

In a Python shell, and using rpy2 when I issue the following command In [93]: x = robjects.r.bfast(data, h=0.1, season="none", max_iter=1) [1] "No seasonal model will be fitted!" I get this non-desirable output [1] "No seasonal model will be…
nskalis
  • 2,232
  • 8
  • 30
  • 49
4
votes
0 answers

Cannot run interactive R session from the command line - windows 10

I cannot run a R session from the command line by typing 'R', despite having C:/Program Files/R and C:/Program Files/R/R-3.3.2/bin in both 'Path' (System) and 'PATH' (User) environment variables (the latter directory is where the actual…
4
votes
1 answer

rpy2 passing python reserved keyword arguments

I am trying to use r's density function through python, and I have to pass the 'from', 'to' arguments to the density functions. However, since the word 'from' is a reserved ketyword in python, how can I achieve this? Thank you. Here is the code so…
ssm
  • 620
  • 6
  • 24
4
votes
2 answers

How to have recognized all the libraries Rpy2 R

How to have recognized all the libraries Rpy2 R. Rpy2 not recognizing the libraries, utils, and tools. import rpy2.robjects as robjects R = robjects.r >>> R['library']("utils") RVector - Python:0x7f65fc85cfc8 / R:0x19bb980 >>>…
Ricardo Rod
  • 8,453
  • 9
  • 27
  • 39
4
votes
1 answer

%load_ext rpy2.ipython Image not found error

I am trying to use the magic command in ipython, something I saw here: rpy2 slides I have done the following: import rpy2.ipython %load_ext rpy2.ipython But I get the following error: ImportError:…
Rohit
  • 5,840
  • 13
  • 42
  • 65
4
votes
1 answer

How can I partition pyspark RDDs holding R functions

import rpy2.robjects as robjects dffunc = sc.parallelize([(0,robjects.r.rnorm),(1,robjects.r.runif)]) dffunc.collect() Outputs [(0, ), (1,
retrocookie
  • 319
  • 2
  • 10
4
votes
2 answers

Memory leak when using pickle in python

I have a big pickle file containing hundreds of trained r-models in python: these are stats models built with the library rpy2. I have a class that loads the pickle file every time one of its methods is called (this method is called several times in…
Marco Mene
  • 397
  • 2
  • 6
  • 11
4
votes
4 answers

issue running a program (R) in Python to perform an operation (execute a script)

I'm tying to execute an R script from python, ideally displaying and saving the results. Using rpy2 has been a bit of a struggle, so I thought I'd just call R directly. I have a feeling that I'll need to use something like "os.system" or…
user393200
  • 43
  • 1
  • 6
4
votes
2 answers

Mapping python tuple and R list with rpy2?

I'm having some trouble to understand the mapping with rpy2 object and python object. I have a function(x) which return a tuple object in python, and i want to map this tuple object with R object list or vector. First, i'm trying to do this : #…
reyman64
  • 523
  • 4
  • 34
  • 73
4
votes
1 answer

How to access a matrix in an .Rdata file in Python using rpy2

I have a number of saved R datasets (though they have .R extensions). I can access one of these matrices fname.R with R, using load("fname.R") and then entering the filename fname. However, I would like to use this matrix in Python. I could use…
ShanZhengYang
  • 16,511
  • 49
  • 132
  • 234
4
votes
5 answers

Failed building wheel for rpy2

I'm running Python v2.7.8 and R v3.0.2 (2013-09-25) -- "Frisbee Sailing" on my elementary OS Freya 64 bit (based on Ubuntu 14.04). I'm trying to install the rpy2 package with: pip install rpy2 and it fails with the error: Failed building wheel for…
Gabriel
  • 40,504
  • 73
  • 230
  • 404