On Fri, Feb 25, 2011 at 5:25 PM, Laurent <lgaut...@gmail.com> wrote:
> On 24/02/11 11:26, Artur Wroblewski wrote:
[...]
>> In Python
>>
>>     >>>  (1, None, 2, None, 3)
>>     (1, None, 2, None, 3)
>>
>> In R
>>
>>     >  c(1, NULL, 2, NULL, 3)
>>     [1] 1 2 3<- NULL is removed, by default
>>
>>     >  c(1, NA, 2, NA, 3)
>>     [1]  1 NA  2 NA  3<- NA is kept, by default
>
>
> There are places where some people can see R as counter-intuitive, and I
> think that this is one such place. Although Python-None seems closer to
> C-Null and R-NULL, the behaviour you describe is what made me have None in
> the list passed to the constructor raise an exception: better explicit than
> implicit when confusion can occur.
> Rather than None, one should be using one of the
> rpy2.rinterface.NA_<whatever>.

I assume, that while using Python, in his/her code, everyone is going to use
None. I do no understand why rpy cannot change None to NA during
conversion to a vector (by default or with some parameter).

Best regards,

Artur

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to