#' Write a table using input data to postgres
#' @param tablename character string of the new table name
#' @param input dataframe to be written to table
#' @import DBI
#' @import DatabaseConnector
#' @export
write_table_to_postgres <-
function(dbname, schema = NULL, tablename, input, port = "5432") {
conn <- connect_to_local_postgres(dbname = dbname,
schema = schema,
port = port)
DBI::dbWriteTable(conn = conn,
name = tablename,
input)
DatabaseConnector::disconnect(conn)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.