Re: [R] RMySQL typing Problem (bigint unsigned)

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Tue 05 Jul 2005 - 00:53:58 EST

On 7/4/2005 9:50 AM, Dubravko Dolic wrote:
> Dear Group,
>
>
>
> if anyone has experience with the RMySQL Package maybe this behaviour is know:
>
>
>
> Reading data from a table into R the fields with datatype bigint(20) unsigned are transformed in some way: e.g. the query "select * from orders where userid = 14929859848712890325" selects the correct case but in R the userid is changed to 14929859848712890368. What happened here? This transformation is true for all fields of that type...

R doesn't have a bigint type, so I imagine these are being changed to doubles. In double precision those are the same number.

I don't know the best way to handle this, but one way would be to do SQL calculations to extract the lower 10 digits separately from the upper 10 digits. R doubles can represent 10 digit integers exactly.

Duncan Murdoch



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jul 05 00:59:09 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:11 EST