Search notes:

R: DBI::dbWriteTable

The DBI function dbWriteTable can be used to write a data frame into a database.
The following example uses the RSQLite package to create a table in a SQLite database and write the data of the data frame df into it. The name of the table to be created is specified with the second parameter (here: r_table):
df <- data.frame (
   col_1 = c(   1,     2 ,      3 ),
   col_2 = c('one', 'two', 'three')
);

library(RSQLite)

db <- dbConnect(
         RSQLite::SQLite(),
         paste0(Sys.getenv('HOME'), '/dbWriteTable.test')
      );

dbWriteTable(db, 'r_data', df);

dbDisconnect(db);
Github repository about-r, path: /packages/DBI/dbWriteTable/insert-data-frame-into-SQLite.R

Index