Last active
July 7, 2017 15:59
-
-
Save thomasnield/e8490021ce0dd32f4a824b909b8f95e7 to your computer and use it in GitHub Desktop.
SQLite and R Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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