[Rpy] RPy2 Interactive Events

2010-11-23 Thread Thomas Kluyver
Hi all, Working with rpy2, I ran into the "why isn't my graph updating when I resize the window?" question. I found the answer in the rinterface documentation [ http://rpy.sourceforge.net/rpy2/doc-2.1/html/rinterface.html#rinterface-interactive-processevents], but I thought I could improve on it i

Re: [Rpy] RPy2 Interactive Events

2010-11-24 Thread Thomas Kluyver
On 24 November 2010 16:38, Laurent Gautier wrote: > Thanks for the contribution. Is your code released under a particular > license, or could it be incorporated in the main code base for rpy2 ? I hadn't thought about licensing for such a small piece of code. I'm happy for you to incorporate it

[Rpy] hg repository

2011-01-27 Thread Thomas Kluyver
When you clone the repository, it will give you the 'default' branch to start working with. By convention, this is the branch where new development happens, and other branches are split off to make more stable releases. At present, rpy2's primary focus of development is the 'version_2.2.x' branch,

Re: [Rpy] newbie questions

2011-05-17 Thread Thomas Kluyver
On 17 May 2011 14:53, Artur Wroblewski wrote: > R returns vector for pi number. More generally, in R, you always work with vectors. So even if you give it the expression "2", it treats it as a vector of length 1. As for attribute access, robjects.r.pi already works for me. You can easily say "

Re: [Rpy] More seg faults (Rpy 2.2.0beta3)

2011-05-18 Thread Thomas Kluyver
Ah, Unicode. I believe the builds from python.org are narrow unicode (i.e. UTF-16), whereas those shipped in many Linux distros (including the one I use) are wide unicode (UTF-32). This might explain why I can't replicate your segfaults. Thomas On 18 May 2011 23:56, Artur Wroblewski wrote: > On

Re: [Rpy] More seg faults (Rpy 2.2.0beta3)

2011-05-19 Thread Thomas Kluyver
On 19 May 2011 08:19, Artur Wroblewski wrote: > On Thu, May 19, 2011 at 12:19 AM, Thomas Kluyver wrote: > > Ah, Unicode. I believe the builds from python.org are narrow unicode > (i.e. > > UTF-16), whereas those shipped in many Linux distros (including the one I > > us

Re: [Rpy] More seg faults (Rpy 2.2.0beta3)

2011-05-19 Thread Thomas Kluyver
On 19 May 2011 19:36, Artur Wroblewski wrote: > At the moment the segfault can be reproduced as follows (using UCS4 > based build) > OK, interesting. I still can't replicate it, in either Python 2.7 or 3.2 wide-unicode builds, with 2.2.0 beta 3. Thomas --

Re: [Rpy] More seg faults (Rpy 2.2.0beta3)

2011-05-19 Thread Thomas Kluyver
On 19 May 2011 20:38, Artur Wroblewski wrote: > What version of gcc, binutils and glibc are you using? > gcc 4.5.2 binutils 2.21.0 glibc 2.13 I don't compile Python myself, though - I let Ubuntu's build servers take care of that. > BTW. Interesting is, that every time (be it os.popen or now)

Re: [Rpy] More seg faults (Rpy 2.2.0beta3)

2011-05-19 Thread Thomas Kluyver
On 19 May 2011 21:08, Laurent Gautier wrote: > >>> ri.NA_Real > NA_real_ > >>> import sys > >>> sys.version > '2.7.1+ (r271:86832, Mar 24 2011, 00:37:39) \n[GCC 4.5.2]' > OK, that's interesting: >>> ri.NA_Real 0.0 >>> sys.version '2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) \n[GCC 4.5.2]' The v

Re: [Rpy] More seg faults (Rpy 2.2.0beta3)

2011-05-19 Thread Thomas Kluyver
On 19 May 2011 22:00, Laurent Gautier wrote: > > Does > >>> import ri > >>> ri.R_VERSION_BUILD > correspond to the R version you are running rpy2 against ? > Yes: 2.12.1, svn rev 53855 > Do you have older versions of rpy2 installed ? If yes, does removing them > solve the problem ? I did hav

Re: [Rpy] More seg faults (Rpy 2.2.0beta3)

2011-05-21 Thread Thomas Kluyver
On 21 May 2011 12:35, Laurent Gautier wrote: > Out of curiosity, do people experiencing problems have 32-bit or 64-bit OS > ? My OS is 32-bit, although I believe that the hardware is x86-64. Like you, I only see problems on 2.7. NA_Real behaves as expected on 3.2. The import problem also only

Re: [Rpy] More seg faults (Rpy 2.2.0beta3)

2011-05-22 Thread Thomas Kluyver
On 22 May 2011 11:51, Laurent Gautier wrote: > The problem might be solved with the revision 1551:19ecaa6a5d6c, and was > in rpy2 and NARealType as people hinted it. > Can people confirm that is now working for them ? > It seems to solve the import problem I had. NA_Real now consistently appear

Re: [Rpy] More seg faults (Rpy 2.2.0beta3)

2011-05-22 Thread Thomas Kluyver
On 22 May 2011 13:51, Laurent Gautier wrote: > This might be linked to the Python console (optimization of some sort, and > custom __repr__ of subtypes of float are ignored). > It returns NA_real_ with either ipython or bpython. > That's plausible. If I explicitly do "repr(ri.NA_Real)", I get 'N

Re: [Rpy] rpy2-2.2.0 release candidate

2011-05-22 Thread Thomas Kluyver
I still see one failure with 2.7: == FAIL: testInitFromSeqInvalidOverflow (rpy2.rinterface.tests.test_SexpVector.IntSexpVectorTestCase) -- Traceback (most recent

Re: [Rpy] can't install on python3

2011-07-13 Thread Thomas Kluyver
On 13 July 2011 09:18, Yo Sato wrote: > I try to install rpy2-2.1 package from the setup.py script, which > throws up compilation errors as below. I am using Arch Linux 64 bit. > Any way to get round the problem? > Does "rpy2-2.1" mean version 2.2.1, or version 2.1.x? Only 2.2.1 is compatible wi

Re: [Rpy] rpy2 - directory conflict with R 2.13.1 in the module rinterface\__init__.py

2011-08-22 Thread Thomas Kluyver
On 22 August 2011 11:01, Jiri Pik wrote: > Actually, what distribution of R is supported? I assume part of the > problem is that rpy2 depends on some custom built R package, not the > standard one from > http://cran.opensourceresources.org/bin/windows/base/R-2.13.1-win.exe > Rpy2 works with

Re: [Rpy] rpy2 and Windows7

2011-08-24 Thread Thomas Kluyver
On 24 August 2011 16:27, Richard Dijkstra wrote: > Rpy2 is not supported anymore under Windows, I assume also not W7. > No solution, but an answer. > Jiri (CCed) is working on getting the latest version building with Windows, but it's not trivial. In the mean time, the last version with a Window

Re: [Rpy] rpy2 and Windows7

2011-08-24 Thread Thomas Kluyver
On 24 August 2011 17:21, Laurent Gautier wrote: > So far the only sponsorship was Google through a GSoC project, funding a > student - Greg. It helped progress a lot toward compatibility with Python 3: > current rpy2 builds and pass all but one unit test (numpy-related > capabilities being not te

Re: [Rpy] Rpy2 with python 2.4

2011-09-16 Thread Thomas Kluyver
On 16 September 2011 21:21, Hajas, Wayne wrote: > Is there an easy way to get RPY2 running under python 2.4? Perhaps there > is an old installation file that I couldn't find. Try the different versions from sourceforge: http://sourceforge.net/projects/rpy/files/rpy2/ I don't know how far back

Re: [Rpy] How to pass "na.rm=True" to a function

2011-10-02 Thread Thomas Kluyver
On 2 October 2011 20:47, W. Thornton Martin wrote: > z_month = r.aggregate(z1, r['as.yearmon'], r.mean, r['na.rm']=True) > > The "na.rm" part does not work, however. What should the syntax be? > I believe rpy2 converts . to _ to make things valid Python names. So try with na_rm=True. Thomas --

Re: [Rpy] Problems with DESeq library in rpy

2011-10-07 Thread Thomas Kluyver
On 7 October 2011 11:57, Nick Schurch wrote: > r('estimateVarianceFunctions <- > function(){load("mySavedR.rdata")\nx=estimateVarianceFunctions(z)\nreturn(x)}') > > and then call it from python: > > >>> test = r.estimateVarianceFunctions() > > I get: > > Traceback (most recent call last): > Fil

Re: [Rpy] Unable to install rpy2 on Amazon EC2 Instance running Ubuntu 10.04

2011-11-17 Thread Thomas Kluyver
On 17 November 2011 13:07, Arvind IK Chari wrote: > I am trying to install RPy2 in a Ubuntu Linux 32-bit 10.04 instance in > Amazon EC2. > I've not used EC2, but I assume you've got access to the Ubuntu repositories. Unless you need a newer version of rpy2, it's probably simplest just to install

Re: [Rpy] question, problem with arguments in r function

2011-12-01 Thread Thomas Kluyver
On 1 December 2011 15:59, Marko Limbek wrote: > resmca = r.MCA(datapm, ncp=3, quali.sup=r.c(4, 5, 6)) A Python keyword argument can't contain a dot. AFAIK, rpy2 automatically translates those cases to use underscores, so try quali_sup=... Thomas

Re: [Rpy] Dictionary Order

2011-12-08 Thread Thomas Kluyver
On 8 December 2011 13:04, federico vaggi wrote: > Why not use http://pypi.python.org/pypi/ordereddict ? > If you're using Python 2.7/3.1+, it's in the standard library: http://docs.python.org/library/collections#collections.OrderedDict Thomas

Re: [Rpy] Complex statistical methods

2011-12-09 Thread Thomas Kluyver
On 9 December 2011 07:11, Marko Limbek wrote: > When I try to import OrderedDict I get this error. I am afraid I cannot > import it with my python version. Is that true? If you're using Python 2.6, you need to download the module Federico linked to. It's available from collections in 2.7. Whet

Re: [Rpy] How do use rgb/how to color histograms?

2012-02-24 Thread Thomas Kluyver
On 23 February 2012 18:28, Niek de Klein wrote: > > r['plot']( p1, col=r['rgb'](0,0,1,1/4), > xlim=R.vectors.IntVector([0,10]))  # first histogram > > r['plot']( p2, col=r['rgb'](1,0,0,1/4), > xlim=R.vectors.IntVector([0,10]), add=True)  # second > > > This gives the same overlapping histo

Re: [Rpy] Unicode problem

2012-03-05 Thread Thomas Kluyver
On 5 March 2012 16:19, Laurent Gautier wrote: > I don't think that rpy works with Python3 at all. To avoid any confusion: rpy almost certainly only works on Python 2, while rpy2 works on Python 2 or Python 3. Thomas --

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-25 Thread Thomas Kluyver
On 25 March 2012 20:17, Yuanda Zhu wrote: > AttributeError:'module' object has no attribute 'popen3' Can you post the traceback that goes with this? It's most likely a bug somewhere, as popen3 calls should be replaced using the subprocess module (see http://docs.python.org/library/subprocess.htm

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-25 Thread Thomas Kluyver
s\command\build.py", line 126, in run >>     self.run_command(cmd_name) >>   File "F:\Python32\lib\distutils\cmd.py", line 313, in run_command >>     self.distribution.run_command(command) >>   File "F:\Python32\lib\distutils\dist.py", line 935, in ru

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-26 Thread Thomas Kluyver
mas, > > Please excuse my limited knowledge. I do not quite know how to replace it. > Could you please write the full syntax for me? By the way, is this a > compatibility problem between Python 3.2.2 and rpy2? > > Many thanks, > > Y.Z. > On Mon, Mar 26,

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-26 Thread Thomas Kluyver
On 26 March 2012 10:50, Thomas Kluyver wrote: > I haven't tested this, but it should be something like: Email formatting mangled that a bit. Here it is in a pastebin: https://gist.github.com/2204230 Thomas --

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-26 Thread Thomas Kluyver
on >     if rversion.startswith("WARNING"): > TypeError: startswith first arg must be bytes or a tuple of bytes, not str > > > Please help. > > Thanks, > > Y.Z. > > > On Mon, Mar 26, 2012 at 5:52 PM, Thomas Kluyver wrote: > >> >> On 26 Mar

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-26 Thread Thomas Kluyver
12 12:06, Yuanda Zhu wrote: >>>> > Hi Thomas, >>>> > >>>> > Thank you very much for your code. I ran it and it showed that >>>> > >>>> > >>>> >   File "G:\Backup\Setup\Python\Packages\rpy2-2.2.5\set

Re: [Rpy] Plotting through rpy2

2012-05-22 Thread Thomas Kluyver
On 23 May 2012 00:00, Shyam Saladi wrote: > The histogram has clearly been plotted by the values of my array are shown > as well It looks like it's tried to use a representation of the array as the title and x-axis label. If you call hist with sensible names for main= and xlab=, does it look OK?

Re: [Rpy] Plotting with RPy

2012-10-18 Thread Thomas Kluyver
On 18 October 2012 11:34, Shane Carey wrote: > from rpy import * Unless you particularly need to use rpy, I think the advice is to use rpy2 (http://rpy.sourceforge.net/rpy2.html ). Thomas -- Everyone hates slow websites

Re: [Rpy] Plotting with RPy

2012-10-18 Thread Thomas Kluyver
On 18 October 2012 15:51, Shane Carey wrote: > I have downloaded RPY2, but when I go to install it, I get the following > error, > Error Tried to guess R's HOME but no R command in the PATH > Any idea about this? Oh, sorry, I've just noticed you're on Windows. I think rpy2 still needs someone to

Re: [Rpy] Error Tried to guess R's HOME but no R command in the PATH

2012-12-11 Thread Thomas Kluyver
On 11 December 2012 17:07, Laurent Gautier wrote: > I was bugfixing 2.3.0, and since at it I implemented the suggested > changes to the default (dev) branch. That's completely untested; someone > should try. Just looking at the code, I doubt it will work: rp = (p.stdin, p.stdout, p.stderr) ..

Re: [Rpy] How do I debug a crash in the windows build of rpy2?

2013-01-02 Thread Thomas Kluyver
On 2 January 2013 14:25, Johan Johansson wrote: > +if sys.version.find("64 bit") > 0: General Pythonicness tip, you can check it more readably like this: if '64 bit' in sys.version: Best wishes, Thomas -- Mast

Re: [Rpy] How to plot pandas DataFrames and their numpy columns with Rpy2?

2013-02-10 Thread Thomas Kluyver
While we're on the subject, by the way, I have a pull request open on IPython to improve how we handle a simple pandas DataFrame being passed into rmagic. I imagine this is quite a common case, and at present rmagic makes a complete mess of it, so I'd like to get some improvement in before our next

Re: [Rpy] How to plot pandas DataFrames and their numpy columns with Rpy2?

2013-02-11 Thread Thomas Kluyver
On 11 February 2013 08:06, Luca Beltrame wrote: > Looking at what Laurent made in rpy2, I think that way is much better than > the > one I wrote. Laurent, if you make a release containing that converter soon, > I'll make a PR to pandas to use that code path. This will mean of course > that > newer

Re: [Rpy] Addition to R vectors not behaving as expected (as in R)

2013-03-21 Thread Thomas Kluyver
On 21 March 2013 14:28, Laurent Gautier wrote: > In Python this is an error. > >>> x+3 > Traceback (most recent call last): > File "", line 1, in > TypeError: can only concatenate list (not "int") to list > With a list, yes. With a numpy array, which is probably as relevant for many rpy2 user

Re: [Rpy] convert list in python to vector in R syntax question

2013-06-13 Thread Thomas Kluyver
On 12 June 2013 18:28, huang jin wrote: > astsa.acf2(L, 3) # L:a numeric list returned by my omitted code,I checked > it is a valid list If you turn your numeric list into a numpy array using numpy.asarray(L), numpy2ri will convert it to a vector. There may be more direct ways to achieve the sa

Re: [Rpy] (no subject)

2013-11-17 Thread Thomas Kluyver
On 17 November 2013 17:18, Hodgess, Erin wrote: > I'm trying to install Rpy2 on a Centos 5 system. Actually, I had it > installed, but want to upgrade it to match R-3.0.2. So this is what I have: > ... > Traceback (most recent call last): > File "", line 14, in ? > File "/usr/bu

Re: [Rpy] (no subject)

2013-11-17 Thread Thomas Kluyver
On 17 November 2013 19:10, Hodgess, Erin wrote: > This is on a server. The python that I use is 2.7.5, but the system is 2.4 > If you're not using the system Python, you should generally install it using the Python you're using. > I tried to install from a tarball but when I run the python pr

Re: [Rpy] Is the AGP still making sense ?

2013-11-27 Thread Thomas Kluyver
Can I suggest that we bring the discussion back to rpy2? People have been arguing about the abstract merits of different licenses for decades, and we're not going to resolve that debate here. R is GPL licensed, while most of the Python ecosystem in which people use rpy2 uses BSD style licenses. I'

Re: [Rpy] Is the AGP still making sense ?

2013-11-27 Thread Thomas Kluyver
On 27 November 2013 12:09, Alex Mandel wrote: > FYI, if changes are required to rmagic from the rpy2 side, just > contribute it directly to rmagic and pull a new copy back to rpy2 no > license change required. > We'll probably drop rmagic from IPython once it's in a released version of rpy2, so

Re: [Rpy] Is the AGP still making sense ?

2013-11-27 Thread Thomas Kluyver
On 27 November 2013 12:43, Dirk Eddelbuettel wrote: > So you end up _running_ R. And hence inherit its license. > > This is not my project (and I merely look after its integration into Debian > and thereby also Ubuntu) but I would want to make it very clear that tools > like RPy2 (or RInside) ca

Re: [Rpy] License Requirements (Was: Is the AGP still making sense ?)

2013-11-30 Thread Thomas Kluyver
On 30 November 2013 13:11, Laurent Gautier wrote: > Yet, I am not convinced that a BSD-type license is appropriate here. The > liberal licensing types can easily use the project in isolation, either > with a module calling rpy2 > If your intention is that people can write code to call rpy2 (inst