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

rpy2 error after installing r package

I am trying to use the r package called "huge". I am having a problem in rpy2 in that I am trying to install this package, which the code runs fine using the following code: import rpy2.robjects.packages as rpackages # import R's utility…
PutsandCalls
  • 997
  • 1
  • 8
  • 11
6
votes
3 answers

Errors about R_HOME when importing rpy2 (submodule)

when importing rpy2.robjects, I got the following error. It said I have to set the R_HOME environment variable or add the directory of the R interpreter to the PATH. But i do not know how to deal with it. How do you fix it? What should i do? The…
William Song
  • 577
  • 6
  • 17
6
votes
1 answer

How can I import a data frame from R saved as RData to pandas?

I'm trying to import a data frame from R saved as RData to a pandas data frame. How can I do so? I unsuccessfully tried using rpy2 as follows: import pandas as pd from rpy2.robjects import r from rpy2.robjects import…
Franck Dernoncourt
  • 77,520
  • 72
  • 342
  • 501
6
votes
1 answer

ModuleNotFoundError: No module named 'pandas.rpy'

I'm trying to import pandas as pd. I get ModuleNotFoundError: No module named 'pandas.rpy'. Why? I use pandas 0.20.1 + python 3.6 x64 + Windows 7 . Example: import os os.environ['R_HOME'] = 'C:\Program Files\R\R-3.4.0' os.environ['R_USER'] =…
Franck Dernoncourt
  • 77,520
  • 72
  • 342
  • 501
6
votes
1 answer

Use `rpy2` with packages installed for `R` in conda virtual environment?

I have been trying to keep my environment non-redundant and clean so I made an R environment and wiped out all other existing Rs on my computer. That environment is called r-conda and it is in: /Users/jespinoz/anaconda/envs/r-conda/bin/R I…
O.rka
  • 29,847
  • 68
  • 194
  • 309
6
votes
1 answer

Running deseq2 through rpy2

I am trying to run DEseq2 from Python using rpy2. How should I pass the design matrix? My script is as follows: from numpy import * from numpy.random import multinomial, random from rpy2 import robjects import…
6
votes
2 answers

How to Install rpy2 on Mac OS X

I am trying, so far unsuccessfully, at installing the rpy2 for python on my Mac OSX. I have tried Macports and DarwinPorts but have had no luck with import rpy2 within the python shell environment. I don't know much about programming in Mac and I…
myClone
  • 1,609
  • 5
  • 17
  • 28
6
votes
1 answer

rpy2 error after upgrading to OSX El Capitan

I have an error occurring in a very similar way to this SO question. The solution of simply installing rpy2 using conda doesn't work. The key difference in my case is that rpy2 worked properly before I updated to Mac OSX 10.11 (El Capitan). My…
Clayton
  • 1,525
  • 5
  • 19
  • 35
6
votes
1 answer

How to use bioconductor from rpy2?

I'm trying to use bioconductor (Specifically seqLogo) from rpy2. I found the helpful package: http://pythonhosted.org/rpy2-bioconductor-extensions/index.html however when I try this from the documentation of the package: import rpy2.robjects as…
user248237
6
votes
1 answer

Rpy2 Installation issue, windows 7

I am trying to find solution for my problem, so far not with success. I am trying to install latest Rpy2 version on my computer. I already have all required programs (R 2.15.1 and 2.7 Python) installed. I am installing Rpy2 (rpy2-2.3.0) trough cmd…
Domagoj
  • 1,674
  • 2
  • 16
  • 27
5
votes
1 answer

import rpy quietly

My question is analogous to this one but in the context of importing R to Python via RPy. Specifically, when I run from rpy import * at the beginning of my python script, there is a chunk of message dumped to the screen (or output device), starting…
Zhang18
  • 4,800
  • 10
  • 50
  • 67
5
votes
2 answers

rpy2 throws a NotImplementedError concerning Conversion rules

I'm trying to implement R code inside some Python (3.10) software using rpy2 (3.5.7). I want to know whether I can get rpy2 to work before trying anything complicated. This is an "off-the-shelf" execution, using one of the earliest examples in the…
Anthony Nash
  • 834
  • 1
  • 9
  • 26
5
votes
4 answers

OSError: cannot load library 'C:\Program Files\R\R-4.0.2\bin\x64\R.dll': error 0x7e

I am trying to import the rpy2 library into a Jupyter Notebook but I cannot get past this error. The PATH 'C:\Program Files\R\R-4.0.2\bin\x64' has been added. This is the only version of R installed on my computer. I have completely uninstalled and…
Grayson Felt
  • 97
  • 1
  • 13
5
votes
0 answers

Jupyter OSError 0x7e when loading rpy2

I'm on windows 10, I have a freshly installed Anaconda Python 3.7 64 bit and I'd like to run my jupiter notebook on my D: drive for reasons. Then I open my jupyter command, and place myself in D: before launching jupyter notebook. When I want to…
H. Vilbert
  • 119
  • 6
5
votes
1 answer

Why does Pip disregard configured repository with nested dependencies?

Problem Let us say I have a completely empty Python+Pip+R (pip 19.3.1) environment on a Linux machine and I want to install the package rpy2 with pip. Since I am behind a corporate firewall I configure pip to use a private…
trallnag
  • 2,041
  • 1
  • 17
  • 33