rpy2

Install rpy2 returns an error

做~自己de王妃 提交于 2019-12-02 02:41:37
I am using Linux, Debian based, and trying to install rpy2 with pip3. When type: sudo pip3 install rpy2 I get user@huayra:~$ sudo pip3 install rpy2 Collecting rpy2 Using cached rpy2-2.9.2.tar.gz Complete output from command python setup.py egg_info: Error: Tried to guess R's HOME but no command 'R' in the PATH. ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-r6axcg8n/rpy2/ I have pip3 installed, the version is: pip 9.0.1 from /usr/local/lib/python3.4/dist-packages (python 3.4) EDIT After some updates I re-run the command

How can I partition pyspark RDDs holding R functions

给你一囗甜甜゛ 提交于 2019-12-01 19:39:07
import rpy2.robjects as robjects dffunc = sc.parallelize([(0,robjects.r.rnorm),(1,robjects.r.runif)]) dffunc.collect() Outputs [(0, <rpy2.rinterface.SexpClosure - Python:0x7f2ecfc28618 / R:0x26abd18>), (1, <rpy2.rinterface.SexpClosure - Python:0x7f2ecfc283d8 / R:0x26aad28>)] While the partitioned version results in an error: dffuncpart = dffunc.partitionBy(2) dffuncpart.collect() RuntimeError: ('R cannot evaluate code before being initialized.', <built-in function unserialize> It seems like this error is that R wasn't loaded on one of the partitions, which I assume implies that the first

How can I partition pyspark RDDs holding R functions

我是研究僧i 提交于 2019-12-01 19:13:50
问题 import rpy2.robjects as robjects dffunc = sc.parallelize([(0,robjects.r.rnorm),(1,robjects.r.runif)]) dffunc.collect() Outputs [(0, <rpy2.rinterface.SexpClosure - Python:0x7f2ecfc28618 / R:0x26abd18>), (1, <rpy2.rinterface.SexpClosure - Python:0x7f2ecfc283d8 / R:0x26aad28>)] While the partitioned version results in an error: dffuncpart = dffunc.partitionBy(2) dffuncpart.collect() RuntimeError: ('R cannot evaluate code before being initialized.', <built-in function unserialize> It seems like

rpy2 error after upgrading to OSX El Capitan

末鹿安然 提交于 2019-12-01 16:28:07
问题 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 Python version is Python 2.7.10 , conda: 3.18.4 , R: R version 3.2.2 (2015-08-14) -- "Fire Safety and all were installed using the anaconda distribution. I get the following error: ImportError: dlopen(/Users/user/anaconda/lib/python2.7/site-packages

install rpy2 on Windows7 64bit for Python 2.7

混江龙づ霸主 提交于 2019-12-01 15:26:14
I am trying to build and install rpy2 Python Module. But got an error (see below). I have R installed in C:\Program Files\R\R-2.15.0\ and R.h is in C:\Program Files\R\R-2.15.0\include . How can I tell setup.py to find the R header in that directory? Both Python and R were installed using official binary file for Windows 64bit. Can someone contribute a rpy2 binary build for windows 64bit and Python2.7 64bit? Christoph Gohlke said for legal or technical reasons, rpy2 is not included in his Unofficial Windows Binaries for Python Extension Packages . Anyone else has a successful hit? Thanks! Given

Statistics Tests (Kolmogorov and T-test) with Python and Rpy2

人走茶凉 提交于 2019-12-01 11:15:35
I've runned some algorithms and wanted to make some statistics analysis with the results. I have two vectors with the averages of the error rate. With R, using the line below I would get everything. t.test(methodresults1,methodresults2,var.equal=FALSE,paired=FALSE,alternative="less") Since I'm using Python, I wanted to use Rpy2 project. I tried that: import rpy2.robjects as R # methodresults1 and methodresults2 are numpy arrays. # kolmogorov test normality_res = R.r['ks.test'](R.FloatVector(methodresults1.tolist()),'pnorm',mean=R.FloatVector(methodresults1.mean().tolist()),sd=R.FloatVector

Statistics Tests (Kolmogorov and T-test) with Python and Rpy2

筅森魡賤 提交于 2019-12-01 09:27:25
问题 I've runned some algorithms and wanted to make some statistics analysis with the results. I have two vectors with the averages of the error rate. With R, using the line below I would get everything. t.test(methodresults1,methodresults2,var.equal=FALSE,paired=FALSE,alternative="less") Since I'm using Python, I wanted to use Rpy2 project. I tried that: import rpy2.robjects as R # methodresults1 and methodresults2 are numpy arrays. # kolmogorov test normality_res = R.r['ks.test'](R.FloatVector

Installing rpy2 on windows

ⅰ亾dé卋堺 提交于 2019-12-01 08:50:42
问题 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 Files\R\R-3.4.4\bin\ to my path environment variable. Now when I do pip install rpy2 I get a different error: Command '('c:\PROGRA~1\R\R-34~1.4\bin\x64\R', 'CMD', 'config', '--ldflags')' returned non-zero exit status 1 The full output is given below. Any idea

rpy2 importr failing with xts and quantmod

落花浮王杯 提交于 2019-12-01 06:09:41
问题 I'm new to rpy2 and am having trouble using importr to import the R packages 'xts' and 'quantmod' Code is: from rpy2.robjects.packages import importr xts = importr('xts') quantmod = importr('quantmod') Errors are: LibraryError: Conflict when converting R symbol in the package "xts" to a Python symbol (.subset.xts -> _subset_xts while there is already _subset_xts) LibraryError: Conflict when converting R symbol in the package "quantmod" to a Python symbol (skeleton.TA -> skeleton_TA while

How to set the R_HOME environment variable to the R home directory?

懵懂的女人 提交于 2019-11-30 21:11:50
I am trying to import rpy2 into python and I am getting this error: RuntimeError: The R home directory could not be determined. Try to install R <https://www.r-project.org/>, set the R_HOME environment variable to the R home directory, or add the directory of the R interpreter to the PATH environment variable. I am completely lost here as I have no idea what this is telling me. I tried to search up how to set the environment variable and couldn't find anything detailed enough that was helpful for me. I would appreciate it if the answer could be very straightforward as I am just a newbie. I am