rpy2

Error when installing rpy2 module in Python with easy_install

╄→гoц情女王★ 提交于 2019-12-17 20:30:54
问题 I've been trying to install the rpy2 module so I can use R functions inside my Python script, but I'm getting an error after following the advice from these pages: 1) Tried to guess R's HOME but no R command in the PATH. OsX 10.6 2) http://rpy.sourceforge.net/rpy2/doc-dev/html/overview.html What I've done so far: 1) Edited my path environment variable to include "C:\Program Files\R\R-3.1.0\bin\x64;" 2) Created a new environment variable called "R_HOME" and set its value to "C:\Program Files\R

Encountering error when installing rpy2: Tried to guess R's HOME but no R command in the PATH

断了今生、忘了曾经 提交于 2019-12-17 18:56:14
问题 I've seen a lot of posts here and elsewhere about this error, but none of the proposed solutions appear to be relevant. I'm on Python 2.7.9, I have an R executable in my path, and I'm trying to install it on an RHEL server not on Windows. Here's the specific error I'm seeing. Does anybody have any idea what would be causing it or how to fix it? Thanks! $ pip install rpy2 Downloading/unpacking rpy2 Downloading rpy2-2.5.6.tar.gz (165kB): 165kB downloaded Running setup.py (path:/tmp/pip_build

rpy2 install on windows 7

左心房为你撑大大i 提交于 2019-12-17 04:53:48
问题 I'm trying to install rpy2 on my computer, but I wasn't able to do it. I downloaded the source package and I tryed to install Rpy2 (rpy2-2.3.2) using the command python setup.py install . This is the result: running install running build running build_py running build_ext "C:\PROGRA~1\R\R-215~1.2\bin\R" CMD config --ldflags "C:\PROGRA~1\R\R-215~1.2\bin\R" CMD config --cppflags "C:\PROGRA~1\R\R-215~1.2\bin\R" CMD config LAPACK_LIBS returned an empty string. "C:\PROGRA~1\R\R-215~1.2\bin\R" CMD

rpy2 install on windows 7

坚强是说给别人听的谎言 提交于 2019-12-17 04:53:04
问题 I'm trying to install rpy2 on my computer, but I wasn't able to do it. I downloaded the source package and I tryed to install Rpy2 (rpy2-2.3.2) using the command python setup.py install . This is the result: running install running build running build_py running build_ext "C:\PROGRA~1\R\R-215~1.2\bin\R" CMD config --ldflags "C:\PROGRA~1\R\R-215~1.2\bin\R" CMD config --cppflags "C:\PROGRA~1\R\R-215~1.2\bin\R" CMD config LAPACK_LIBS returned an empty string. "C:\PROGRA~1\R\R-215~1.2\bin\R" CMD

controlling order of points in ggplot2 in R?

僤鯓⒐⒋嵵緔 提交于 2019-12-17 03:04:20
问题 Suppose I'm plotting a dense scatter plot in ggplot2 in R where each point might be labeled by a different color: df <- data.frame(x=rnorm(500)) df$y = rnorm(500)*0.1 + df$x df$label <- c("a") df$label[50] <- "point" df$size <- 2 ggplot(df) + geom_point(aes(x=x, y=y, color=label, size=size)) When I do this, the scatter point labeled "point" (green) is plotted on top of the red points which have the label "a". What controls this z ordering in ggplot, i.e. what controls which point is on top of

Installation issue: “python setup.py egg_info” failed with error code 1

无人久伴 提交于 2019-12-14 04:13:12
问题 I get the following error after running pip install rpy2 on a mac with OSX 10.11.2 and Python 2.7.12: Collecting rpy2 Downloading rpy2-2.8.2.tar.gz (186kB) 100% |████████████████████████████████| 194kB 3.0MB/s Complete output from command python setup.py egg_info: Warning: 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 /private/var/folders/ml/wk8739s920z0rq1_rjrb2z980000gn/T/pip

How to use the variable from the python in rpy2?

邮差的信 提交于 2019-12-14 03:33:26
问题 My simple program extracts the database from Python and store in the variable row. cursor = con.cursor() cursor.execute("SELECT * FROM traffic") #Retrieves data from SQL rows = cursor.fetchall() for row in rows: row = list(row) a = row[1:] b = row[:-1] print(a) print(b) Now that I am able to get the month and traffic in list a and b like [1000L] ['January'] [100L] ['February'] [10430L] ['March'] [1500L] ['April'] [100L] ['May'] [1200L] ['June'] [800L] ['July'] [8000L] ['August'] [100000L] [

Converting a R ListVector to a Python list with rpy2

放肆的年华 提交于 2019-12-14 01:26:16
问题 I have a function that takes the items in a Python list, puts them through a function in R, and outputs them as a R ListVector. The problem is that I can't find in the documentation how to convert from a ListVector into a regular Python object. Here's my code: from rpy2.robjects.packages import importr from rpy2.robjects import r forecast = importr("forecast") parallel = importr("multicore") data = [[1, 2, 3], [4, 5, 6,], [7, 8, 9]] tuples = tuple(tuple(x) for x in data) data_list = [] for i

rpy2 dtw missing argument window.size

痴心易碎 提交于 2019-12-13 18:26:09
问题 I'm using the R DTW package with rpy2. I would like to be able specify a window type and size for running the DTW analysis. I have run the following code: import numpy as np import rpy2.robjects as robjects import rpy2.robjects.numpy2ri rpy2.robjects.numpy2ri.activate() r = robjects.r r('library("dtw")') query = np.array([0.0,1.0,2.0,3.0]) reference = np.array([0.0,1.9,2.4,3.0]) # Attempt 1: kwargs = {'step':r("asymmetric"),'window_type':r("sakoeChibaWindow"),'window_size':r("as.integer(\"3\"

LD_LIBRARY_PATH precendence and trouble with compiling

巧了我就是萌 提交于 2019-12-13 14:09:00
问题 I am trying to install some software on a Linux machine (python's rpy2 package, rpy2.robjects in particular, if it matters). I need the software to look for its shared libraries in my local space, not in the global spaces like /usr/lib64 whatever. I do not have admin privileges on this machine. My problem is that even though I set LD_LIBRARY_PATH to point to my local space, the software still goes to the /usr/lib64/whatever, where it finds libraries that are out of date. These libraries are