Skip to content

Instantly share code, notes, and snippets.

@thomasnield
Last active July 7, 2017 15:59
Show Gist options
  • Select an option

  • Save thomasnield/e8490021ce0dd32f4a824b909b8f95e7 to your computer and use it in GitHub Desktop.

Select an option

Save thomasnield/e8490021ce0dd32f4a824b909b8f95e7 to your computer and use it in GitHub Desktop.
SQLite and R Example
setwd('c:\\git')
library(DBI)
library(RSQLite)
db <- dbConnect(SQLite(), dbname='rexon_metals.db')
myQuery <- dbSendQuery(db, "SELECT * FROM CUSTOMER")
my_data <- dbFetch(myQuery, n = -1)
dbClearResult(myQuery)
print(my_data)
# RESOURCE: http://tiffanytimbers.com/querying-sqlite-databases-from-r/
# DBI: https://cran.r-project.org/web/packages/DBI/index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment