rq_copy_to | R Documentation |
Copy local R table to remote data handle.
rq_copy_to(
db,
table_name,
d,
...,
qualifiers = NULL,
overwrite = FALSE,
temporary = TRUE,
rowidcolumn = NULL
)
db |
database connection handle. |
table_name |
name of table to create. |
d |
data.frame to copy to database. |
... |
force later argument to be by name |
qualifiers |
optional named ordered vector of strings carrying additional db hierarchy terms, such as schema. |
overwrite |
logical, if TRUE try to overwrite existing table. |
temporary |
logical, if TRUE try to mark table as temporary. |
rowidcolumn |
character, name to land row-ids. |
a relop representation of the data
db_td
, mk_td
, materialize
, execute
, to_sql
if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) {
db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
d <- rq_copy_to(db, 'd',
data.frame(AUC = 0.6, R2 = 0.2))
sql <- to_sql(d, db)
cat(sql)
print(DBI::dbGetQuery(db, "SELECT * FROM d"))
DBI::dbDisconnect(db)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.