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

ValueError when importing rpy2

import rpy2 import rpy2.robjects as ro from rpy2.robjects.packages import importr import rpy2.robjects.numpy2ri it gives the error as ValueError: r_home is None. Try python -m rpy2.situation the last call is File…
-1
votes
1 answer

equivalent of “~” in rpy2?

Simple question that I can't seem to find the answer to. How would I get an attribute of an R object in rpy2? For example, what's the equivalent of the R code: y~x in rpy2?
-1
votes
1 answer

How to remove all rpy2 packages?

How can I remove all packages that I installed with rpy2 with anaconda? I have an error, and saw many times that it may be due to corrupted packages, so I want to remove them all to check it
Alexander Ivanov
  • 195
  • 2
  • 10
-1
votes
1 answer

Running rpy2 gives me the error LookupError: tzone

I try to import some R library in python through rpy2 (rpy2>=3.0). However i get the error below. Using python 2 and rpy2==2.80 this works. As well as using python 3 and rpy2==2.9.1. Traceback (most recent call last): File "testMultipipsa.py",…
-1
votes
1 answer

how to call a function from R in Python?

I have this function in R and I want to call it in python. I am planning to assign the data which has been manipulated in python to the R function to do further analysis on it. I also need to have the data back to python after the function did the…
K S
  • 3
  • 6
-1
votes
2 answers

R & Python: How to use a string to reach into a dataframe/matrix in R

I am currently using Python and R together (using rmagic/rpy2) to help select different user input variables for a certain type of analysis. I have read a csv file and created a dataframe in R. What I have also done is allowed the users to input a…
tbaker
  • 9
  • 1
-1
votes
2 answers

Converting R to ryp2

I am trying to run some R code from within a python script. To do this I am using rpy2 but having difficulty (could also just call an R script but I can't get that to work either). Below is the R script code that does what I want it to…
The Nightman
  • 5,609
  • 13
  • 41
  • 74
-1
votes
1 answer

Using the R select function in Python using rpy2

I'm trying to covert UniProt accession numbers to Entrez IDs using the BioconductoR package org.Hs.eg.db (which is an S4 object). I'm also trying to do this as part of a Python script with rpy2. Calling the select function gives me errors. Here's…
hannah
  • 889
  • 4
  • 13
  • 27
-1
votes
1 answer

rpy2 failed to load some bioconductor packages

Recently our system updated R to 3.2.1 (in a separate location). Since then I have trouble loading certain packages in rpy2. What I have tried: set LD_LIBRARY_PATH to current path un-install then reinstall rpy2 un-install then reinstall packages…
xyliu00
  • 726
  • 1
  • 9
  • 24
-1
votes
2 answers

Read R function output as columns

I'm trying to come up with a way to solve this question I asked yesterday: rpy2 fails to import 'rgl' R package My goal is to check if certain packages are installed inside R from within python. Following the recommendation by Dirk Eddelbuettel…
Gabriel
  • 40,504
  • 73
  • 230
  • 404
-1
votes
2 answers

issue using r function with rpy2

When I do from rpy2.robjects import IntVector, Formula from rpy2 import robjects rr = Formula('gr_bmr~nationalite_france') myparams = {'family': 'binomial'} formula=robjects.r('gr_bmr~nationalite_simple')…
-1
votes
1 answer

Python to build website

I just used the Django tutorial to build a web site yesterday and I know very little Python as well. This might be a total Noob question, but any response is appreciated. I’m planning to use Python + Django to build a webpage which is going to…
-2
votes
1 answer

pip install rpy2==3.2.7 error with code 1

Please anyone help me, i got these when pip install rpy2==3.2.7 : Collecting wheel Using cached https://files.pythonhosted.org/packages/8c/23/848298cccf8e40f5bbb59009b32848a4c38f4e7f3364297ab3c3e2e2cd14/wheel-0.34.2-py2.py3-none-any.whl Installing…
-2
votes
1 answer

Using R in Python with rpy2

I currently have an R code that works very well and i want to use rpy2 package to use this code in python. The code show a Sunburst in R: library(sunburstR) sequences <-…
Laurent TEMO
  • 73
  • 1
  • 8
-2
votes
2 answers

How can I import a matrix from R saved as RData to a pandas data frame without losing the column names of the R matrix?

How can I import a matrix from R saved as RData to a pandas data frame without losing the column names of the R matrix? For example, if I have saved this matrix in R: A = matrix( c(2, 4, 3, 1, 5, 7), # the data elements nrow=2, …
Franck Dernoncourt
  • 77,520
  • 72
  • 342
  • 501
1 2 3
80
81