I am new to the database connection capabilities of dplyr package, but I am very interested in using it for an SQLite connection. I followed this tutorial and created an SQL
In this newsgroup.
Hadley explained the purpose of the function dplyr::copy_to()
.
It is intended to create temporary test tables.
The email exchange ends by suggesting to use RMySQL::dbWriteTable()
to append data to an existing table. The same applies to SQLite databases, as explained in the accepted answer above.
To append a data frame dtf
which has the same column names as an existing database table, I used:
library(RMySQL)
DB <- dbConnect(MySQL(), user="usename", host="localhost",
password="***", dbname="dbname")
dbWriteTable(DB, "tablename", dtf, append=TRUE, row.names = FALSE)