[Just to stress that an issue similar to the one with NA_LOGICAL, fixed
with 2.0.2, is *not* present here]
'FALSE' rather than False in the Python code is indeed the cause of the
problem, but parameters in the signature of the function are not typed.
'FALSE' is passed to R as a string "FALSE", and when the qt function is
evaluated tries to get a boolean / logical it produces an NA, reported
upon return as a warning.
In R:
> qt(p=0.05, df=25,lower.tail="FALSE")
[1] -1.708141
Warning message:
In qt(p = 0.05, df = 25, lower.tail = "FALSE") : NAs introduced by coercion
laurent oget wrote:
> 'FALSE' is a string, which somehow when converted to a boolean
> evaluates as True.
>
> How do you like:
>
>
>>>> kwargs={'df':25,'lower.tail':False}
>>>> print ro.r['qt'](0.05, **kwargs)
> [1] 1.708141
>
>
> 2009/2/4 Lindsey Bangay <[email protected]>:
>> HI
>>
>> I am new to rpy2, but I would appreciate some assistance on this problem
>>
>> I want to calculate the quantile of the t-distribution, using the upper tail:
>>>>> import rpy2.robjects as ro
>>>>> kwargs={'df':25,'lower.tail':'FALSE'}
>>>>> print ro.r['qt'](0.05, **kwargs)
>> but this is what I get :
>>
>> Warning message:
>>
>> In function (p, df, ncp, lower.tail = TRUE, log.p = FALSE) :
>> NAs introduced by coercion
>>
>> [1] -1.708141
>>
>> I am using the latest rpy2, R version 2.8.1 (2008-12-22)
>> and python2.6
>>
>> Any help or insight, particularly if it is simple finger trouble on my part,
>> appreciated.
>>
>> I do realise that I can easily workaround this to get what I want from this
>> answer, but I do not understand why it is not producing the expected answer
>> that I would get in R, as in
>>> qt(p=0.05, df=25,lower.tail=FALSE)
>> [1] 1.708141
>>
>>
>> Thanks
>> Lindsey
>> --
>> Lindsey Bangay
>> Dept of Statistics, Rhodes University, Grahamstown
>> South Africa
>> +27 46 6038347 (work)
>> +27 46 6222723 (fax)
>>
>>
>> ------------------------------------------------------------------------------
>> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
>> software. With Adobe AIR, Ajax developers can use existing skills and code to
>> build responsive, highly engaging applications that combine the power of
>> local
>> resources and data with the reach of the web. Download the Adobe AIR SDK and
>> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
>> _______________________________________________
>> rpy-list mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/rpy-list
>>
>
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code to
> build responsive, highly engaging applications that combine the power of local
> resources and data with the reach of the web. Download the Adobe AIR SDK and
> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
> _______________________________________________
> rpy-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rpy-list
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
rpy-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rpy-list