Skip to content

Instantly share code, notes, and snippets.

@klahrich
Created May 31, 2016 17:47
Show Gist options
  • Save klahrich/5a6d9344f31c3a4141c68cc35e0f69b7 to your computer and use it in GitHub Desktop.
Save klahrich/5a6d9344f31c3a4141c68cc35e0f69b7 to your computer and use it in GitHub Desktop.
library(RSQLite)
library(dplyr)
setwd("C:\\Users\\klahrich\\Documents\\R\\retention_pk\\")
db <- dbConnect(SQLite(), dbname="Test.sqlite")
my_db <- src_sqlite("Test.sqlite")
dbWriteTable(conn=db, name="Training", value="training.csv", row.names=FALSE, header=TRUE)
training <- tbl(my_db, sql("SELECT * from Training"))
training %>% count(METHOD_OF_PAYMENT_CD)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment