[R-sig-DB] [RESOLVED] RSQLite dbWriteTable: REAL() can only be applied to a 'numeric', not a 'logical'

Seth Falcon @eth @end|ng |rom u@erpr|m@ry@net
Sat Oct 27 18:21:04 CEST 2007


Hi again,

I believe I have a fix for the issue with logical columns in data
frames.  Before I push an update to CRAN, I would like to hear from
one or two testers...

A source only version is here:

   http://userprimary.net/misc/RSQLite_0.6-4.tar.gz

Details:

When a data frame has a logical column, its values will be converted
to integers when stored in SQLite.  Here is the test that I added:

    df <- data.frame(x=1:3, y=c(NA, TRUE, FALSE))

    dbWriteTable(DATA$db, "t1", df)

    got <- dbGetQuery(DATA$db, "select * from t1")

    checkEquals("integer", typeof(got$y))
    checkEquals(as.integer(NA), got$y[1])
    checkEquals(1L, got$y[2])
    checkEquals(0L, got$y[3])

+ seth

-- 
Seth Falcon | seth using userprimary.net | blog: http://userprimary.net/user/




More information about the R-sig-DB mailing list