[R] RSQLite query error

Mikkel Grum mi2kelgrum at yahoo.com
Sat Oct 9 20:13:59 CEST 2004


Dear R-helpers,

I ran the following little test on RSQLite and got the
data below from the query.  Unless I've made some
mistake, the results of both the where and order by
statements have problems:

library(RSQLite)
con<-dbConnect(dbDriver("SQLite"),dbname="test")
data(USArrests)
dbWriteTable(con,"arrests",USArrests,overwrite=TRUE)
dbListTables(con)
dbReadTable(con,"arrests")
dbGetQuery(con,paste("SELECT row_names,Murder,Rape
FROM arrests",
"WHERE Rape>30 ORDER BY Murder"))

       row_names Murder Rape
1         Alaska   10.0 44.5
2     New Mexico   11.4 32.1
3       Michigan   12.1 35.1
4         Nevada   12.2 46.0
5        Florida   15.4 31.9
6   North Dakota    0.8  7.3
7  New Hampshire    2.1  9.5
8          Maine    2.1  7.8
9   Rhode Island    3.4  8.3
10 West Virginia    5.7  9.3
11      Colorado    7.9 38.7
12       Arizona    8.1 31.0
13    California    9.0 40.6

I'm running R 2.0.0 on Windows XP.  Should I make a
bug report or can someone point to an error that I've
made?

cheers
Mikkel




More information about the R-help mailing list