Re: [Rpy] ungraceful quit from R

2009-07-05 Thread Daniel Yuan
> The normal R command line is just a program that loads up the core R > code -- some functions written in C that knows how to evaluate code > written in R, and wraps a UI around them. rpy2 loads up that same core > R code, but into a Python process instead. So you can think of it as > turning your

Re: [Rpy] ungraceful quit from R

2009-07-05 Thread Nathaniel Smith
On Sun, Jul 5, 2009 at 10:18 AM, Daniel Yuan wrote: > Looking a little deeper, I actually do *not* find an R subprocess when > I initialize rpy2. I guess I do not understand exactly how rpy2 is > initializing R without a subprocess. Ah. Yeah, no subprocess here :-). The normal R command line is j

Re: [Rpy] ungraceful quit from R

2009-07-05 Thread Daniel Yuan
>> In conclusion, I don't get it :-) > > I am not any better than Nathaniel: without you telling a little > more of what you are trying to achieve, I am left puzzled. When I execute 'import rpy2.robjects as robjects', I thought Python was spawning a subprocess for R. Quitting the child proces

Re: [Rpy] ungraceful quit from R

2009-07-05 Thread Laurent Gautier
Nathaniel Smith wrote: > On Sun, Jul 5, 2009 at 2:04 AM, Laurent Gautier wrote: >> (''' q <- function(...) { } ''' is only adding a function q() >> in the globalenv; baseenv['q']() would still call the original function). > > Okay, append 'assign("q", q, envir=.BaseEnv)' to that line (if it > rea

Re: [Rpy] ungraceful quit from R

2009-07-05 Thread Nathaniel Smith
On Sun, Jul 5, 2009 at 2:04 AM, Laurent Gautier wrote: > (''' q <- function(...) { } ''' is only adding a function q() > in the globalenv; baseenv['q']() would still call the original function). Okay, append 'assign("q", q, envir=.BaseEnv)' to that line (if it really matters; the goal would be to

Re: [Rpy] ungraceful quit from R

2009-07-05 Thread Laurent Gautier
Nathaniel Smith wrote: > Can I butt in for a moment and ask why we'd even want q() not to exit? > There is (unfortunately) no way to create and destroy multiple R > sessions, because R doesn't have such a capability. Even if there > were, I don't see what q() would have to do with it -- the right A

Re: [Rpy] ungraceful quit from R

2009-07-04 Thread Nathaniel Smith
Can I butt in for a moment and ask why we'd even want q() not to exit? There is (unfortunately) no way to create and destroy multiple R sessions, because R doesn't have such a capability. Even if there were, I don't see what q() would have to do with it -- the right API for creating and destroying

Re: [Rpy] ungraceful quit from R

2009-07-04 Thread Daniel Yuan
> I have just added something in the documentation for 2.1-dev > http://rpy.sourceforge.net/rpy2/doc-dev/html/callbacks.html#clean-up > That will hopefully be enough to get you started. Still no joy: xn...@work:~> python Python 2.5.2 (r252:60911, Nov 26 2008, 00:44:29) [GCC 4.0.1 (Apple Inc. buil

Re: [Rpy] ungraceful quit from R

2009-07-03 Thread Laurent Gautier
Daniel Yuan wrote: > I'm following up on bug 2776713 re. how to set a cleanup callback > using setCleanUp > (https://sourceforge.net/tracker/?func=detail&aid=2776713&group_id=48422&atid=453021 > > ). > > The only place I saw 'setCleanUp' defined was in 'rpy2/rpy/rinterface/ > rinterface.c'.

[Rpy] ungraceful quit from R

2009-07-02 Thread Daniel Yuan
I'm following up on bug 2776713 re. how to set a cleanup callback using setCleanUp (https://sourceforge.net/tracker/?func=detail&aid=2776713&group_id=48422&atid=453021 ). The only place I saw 'setCleanUp' defined was in 'rpy2/rpy/rinterface/ rinterface.c'. I assume this is *not* the place to