Very Basic Guide to Use RSQLite
Very Basic Guide to Use RSQLite Very Basic Guide to Use RSQLite Firstly, you need to load the packages. You could also use lapply to load multiple packages at one go. # Run this first: install.packages(c('RSQLite.extfuns, 'ggplot2')) library(DBI) library(RSQLite) library(ggplot2) library(RSQLite.extfuns) library(plyr) Establish a sqlite connection with a database file, data-metro.db , and store it as db . In C, you might use something like apop_db_open("data-metro.db") If you want to practice the example data, you probably could download the database file from Ben Kleman's blog. Further description about the data is in his book, Modeling with Data . db = dbConnect(dbDriver("SQLite"), dbname = "data-metro.db", loadable.extensions = TRUE) # List the tables in this database, so you know which tables to call for. dbListTables(db) ## [1] "lines" "riders" The dbListTables lets you know which tables are in the d...