rpy2

How to Install rpy2 on Mac OS X

依然范特西╮ 提交于 2019-12-04 06:47:48
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 am a wiz at installing modules on a Windoze based system, but for the life of me cannot do a simple port on my Mac at home. What I am after, if someone would be so kind, are "dumbed down" instructions for a successful install of rpy2 for Mac OSX Snow Leopard. Hopefully someone here has done this successfully and can outline the process they took? At

rpy2 install problems on debian

偶尔善良 提交于 2019-12-04 05:00:50
问题 I have tried every install method I can think of to install RPy2 on our debian server and I get the same message regardless. I have installed and used it successfully on my mac. Is there something I may be missing? start Processing rpy2 Running setup.py -q bdist_egg --dist-dir /opt/rpy2/egg-dist-tmp-oft2ko returned an empty string. returned an empty string. Configuration for R as a library: include_dirs: ('/usr/share/R/include',) libraries: ('R',) library_dirs: ('/usr/lib64/R/lib',) extra

Plots made with rpy sent to X11 suddenly close?

杀马特。学长 韩版系。学妹 提交于 2019-12-04 01:59:59
问题 I'm using RPy2 to make some plots. The plot shows up but the X11 window immediately disappears. All I'm typing is the following, where CCFS is a data matrix import rpy2.robjects as robjects r = robjects.r pca = r.princomp(CCFS) r.plot(pca,main="Eigenvalues") r.biplot(pca,main="biplot") r['dev.off']() #*EDIT* the problem persists even if I remove this line. Am I failing to include something? I know that there is something to plot because princomp returns a ListVector that isn't null. 回答1: Add

convert numpy array to Matrix rpy2, Kmeans

拥有回忆 提交于 2019-12-03 20:49:12
I have a numpy 2D array self.sub and i want to use it in rpy2 kmeans. k = robjects.r.kmeans(self.sub,2,20) i always get the following error: valueError: nothing can be done for the type at the moment! what can i do? From the rpy2 docs , R matrices are just vectors with their dim attribute set. So for a numpy two-dimensional array x import rpy2.robjects as robj nr, nc = x.shape xvec = robj.FloatVector(x.transpose().reshape((x.size)) xr = robj.r.matrix(xvec, nrow=nr, ncol=nc) You have to transpose the numpy array because R fills matrices by columns. Edit: Actually, you could just set byrow=True

Rpy2 not finding package

拈花ヽ惹草 提交于 2019-12-03 13:05:00
I'm using Rpy2 on windows 7 64 and having trouble loading a package: in R: using(mi) in python: from rpy2.robjects.packages import importr mi=importr('mi') --------------------------------------------------------------------------- RRuntimeError Traceback (most recent call last) <ipython-input-30-2d393a6df544> in <module>() ----> 1 mi=importr('mi') C:\Anaconda\lib\site-packages\rpy2\robjects\packages.pyc in importr(name, lib_loc, robject_translations, signature_translation, suppress_messages, on_conflict, data) 397 if _package_has_namespace(rname, 398 _system_file(package = rname)): --> 399

Python rpy2 and matplotlib conflict when using multiprocessing

孤者浪人 提交于 2019-12-03 12:05:38
I am trying to calculate and generate plots using multiprocessing. On Linux the code below runs correctly, however on the Mac (ML) it doesn't, giving the error below: import multiprocessing import matplotlib.pyplot as plt import numpy as np import rpy2.robjects as robjects def main(): pool = multiprocessing.Pool() num_figs = 2 # generate some random numbers input = zip(np.random.randint(10,1000,num_figs), range(num_figs)) pool.map(plot, input) def plot(args): num, i = args fig = plt.figure() data = np.random.randn(num).cumsum() plt.plot(data) main() The Rpy2 is rpy2==2.3.1 and R is 2.13.2 (I

Bizzarre issue trying to make Rpy2 2.1.9 work with R 2.12.1, using Python 2.6 under Windows xp - Rpy can't find the R.dll?

拥有回忆 提交于 2019-12-03 07:42:16
问题 I've been having a real issue trying to make Rpy2 play nice with my R install. I first tried installing the rpy2 MSI package, and this didn't appear to work. When I ran the recommended tests, it was giving me an error saying that it couldn't find the R.dll, because the new R installs (post 2.11) install the DLLs into an i386 folder, where rpy2 can't find them because its looking in the bin folder instead of the bin/i386 folder. Then I tried to build the install from scratch myself using the

rpy2 import is not working

丶灬走出姿态 提交于 2019-12-03 06:29:59
I get an error when I try to import rpy2. Here is the code and error. >>> import pandas.rpy.common Traceback (most recent call last): File "C:\PF\WinPython-64bit-3.3.3.3\python-3.3.3.amd64\lib\site-packages\IPython\core\interactiveshell.py", line 2828, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-148-c258a0f70d44>", line 1, in <module> import pandas.rpy.common File "C:\PF\WinPython-64bit-3.3.3.3\python-3.3.3.amd64\lib\site-packages\pandas\rpy\common.py", line 14, in <module> from rpy2.robjects.packages import importr ImportError: No module named 'rpy2'

Bizzarre issue trying to make Rpy2 2.1.9 work with R 2.12.1, using Python 2.6 under Windows xp - Rpy can't find the R.dll?

荒凉一梦 提交于 2019-12-02 21:09:21
I've been having a real issue trying to make Rpy2 play nice with my R install. I first tried installing the rpy2 MSI package, and this didn't appear to work. When I ran the recommended tests, it was giving me an error saying that it couldn't find the R.dll, because the new R installs (post 2.11) install the DLLs into an i386 folder, where rpy2 can't find them because its looking in the bin folder instead of the bin/i386 folder. Then I tried to build the install from scratch myself using the command line tools (distutils) included with python. This didn't work, because setup.py claimed to be

rpy2 install problems on debian

风格不统一 提交于 2019-12-02 06:23:46
I have tried every install method I can think of to install RPy2 on our debian server and I get the same message regardless. I have installed and used it successfully on my mac. Is there something I may be missing? start Processing rpy2 Running setup.py -q bdist_egg --dist-dir /opt/rpy2/egg-dist-tmp-oft2ko returned an empty string. returned an empty string. Configuration for R as a library: include_dirs: ('/usr/share/R/include',) libraries: ('R',) library_dirs: ('/usr/lib64/R/lib',) extra_link_args: () # OSX-specific (included in extra_link_args) framework_dirs: () frameworks: () warning: no