SQLite analysis in R