[R] RSQLite: rounding

Leonardo Miceli miceli.leonardo at gmail.com
Tue Feb 23 23:31:11 CET 2016

Does anybody here had any problem with rounding using RSQLite?

I have a query which return around 100 thousands records of double 
precision numeric values.

The query returns the numbers with 1 digit precision. But when I run the 
same query but constrains the number of recorded values returned, by 
around 30 records, the precision of the the values is the correct 3 digits!

It is not a matter of formatting, I checked it out. It's really a 
different number returned by the same query only the amount of returned 
data was set different.

Any tips? Something like that had happened to you?

By the way, I put the query below just to see Its simplicity...

 > library(RSQLite)

 > qry1 <- "SELECT * FROM tbFutcotes WHERE Dt >= '1996-01-01' AND 
FK_tbFutureContracts_PK LIKE '%DI1%'"

 > qry2 <- "SELECT * FROM tbFutcotes WHERE Dt >= '2016-02-22' AND 
FK_tbFutureContracts_PK LIKE '%DI1%'"

 > x1 <- dbGetQuery(con, qry1)

 > x2 <- dbGetQuery(con, qry2)

	[[alternative HTML version deleted]]

More information about the R-help mailing list