[R] RSQLite: rounding

Sarah Goslee sarah.goslee at gmail.com
Wed Feb 24 16:06:28 CET 2016


How did you "check it out"? I still suspect a formatting issue.

Please use dput() to provide a bit of data from each, eg
dput(head(x1))
dput(head(x2))

Sarah

On Tue, Feb 23, 2016 at 5:31 PM, Leonardo Miceli
<miceli.leonardo at gmail.com> wrote:
>
> 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)
>



More information about the R-help mailing list