ountry,Year)\ndt$value &lt;- rnorm(nrow(dt))\n\ndt &lt;- dt %&gt;% group_by(Product) %&gt;% mutate(value=value+as.numeric(Product)/10)\ndt &lt;- dt %&gt;% group_by(Country) %&gt;% mutate(value=value+as.numeric(Country)/10)\ndriver = dbDriver("SQLite")\ncon = dbConnect(driver, dbname = "test.db")\ndbWriteTable(con, c("dummy_test"), value=dt %&gt;% data.frame,overwrite=TRUE,row.names=FALSE)\ndbDisconnect(con)\n\nmy_db &lt;- src_sqlite("test.db")\nprint(my_db)\ndbdt &lt;- tbl(my_db,"dummy_test")\n\n##test1\ndb