Re: [Rpy] [patch] expose R_MissingArg

2009-02-10 Thread Laurent Gautier
Nathaniel Smith wrote: > On Mon, Feb 9, 2009 at 11:07 AM, Laurent Gautier wrote: >> Yes. I would actually put at the rinterface/__init__.py level >> (still at the rinterface level, but this would cut down on C-level >> development time). > > Yeah, IME python wrapping is all about writing the thin

Re: [Rpy] [patch] expose R_MissingArg

2009-02-09 Thread Nathaniel Smith
On Mon, Feb 9, 2009 at 11:07 AM, Laurent Gautier wrote: > Yes. I would actually put at the rinterface/__init__.py level > (still at the rinterface level, but this would cut down on C-level > development time). Yeah, IME python wrapping is all about writing the thinnest barest-bones API possible i

Re: [Rpy] [patch] expose R_MissingArg

2009-02-09 Thread Laurent Gautier
Nathaniel Smith wrote: > On Sun, Feb 8, 2009 at 2:22 AM, Laurent Gautier wrote: >> In the case of extracting elements from a matrix, there is a way >> (working in R, as well as in rpy2): >> >> m[2, TRUE] # Note the TRUE ! >> [1] 2 4 > > Ah, cute trick, thanks. > >> I'd be more keen on defining t

Re: [Rpy] [patch] expose R_MissingArg

2009-02-08 Thread Nathaniel Smith
On Sun, Feb 8, 2009 at 2:22 AM, Laurent Gautier wrote: > In the case of extracting elements from a matrix, there is a way > (working in R, as well as in rpy2): > > m[2, TRUE] # Note the TRUE ! > [1] 2 4 Ah, cute trick, thanks. > I'd be more keen on defining the missing magic, as well as NULL and

Re: [Rpy] [patch] expose R_MissingArg

2009-02-08 Thread Laurent Gautier
Nathaniel Smith wrote: > There are several times in R when it is valuable to explicitly leave > an argument missing. For example, when extracting a row from a matrix: > >> m <- matrix(1:4, nrow=2) >> m[2] # Flat indexing > [1] 2 >> m[2, ] # Note the comma! > [1] 2 4 > > However, there is curren

[Rpy] [patch] expose R_MissingArg

2009-02-08 Thread Nathaniel Smith
There are several times in R when it is valuable to explicitly leave an argument missing. For example, when extracting a row from a matrix: > m <- matrix(1:4, nrow=2) > m[2] # Flat indexing [1] 2 > m[2, ] # Note the comma! [1] 2 4 However, there is currently no way to support this (rather idios