dimanche 28 juin 2015

R Returns Wrong Minimum Value

I'm using a SQLite database with approximately 1.2 million records. When I use SQLite,

select min(borrowerCreditScore) from acquisitions;

I get a minimum of 350. I think that is correct.

When I use R

range(dbGetQuery(fnma, "SELECT borrowerCreditScore from acquisitions"))

I get

[1] 0 850

the minimum of 0 is not correct, but the max of 850 is correct.

I duplicated the error with describe and summary with the same result. I also tried

dbGetQuery(fnma, "SELECT COUNT(borrowerCreditScore) from acquisitions where borrowerCreditScore < 300")

and got 0 records, which is correct.

Various queries in SQLite return what appear to be correct answers.

Aucun commentaire:

Enregistrer un commentaire