library("RPostgreSQL")
usr <- "dbuser"
pwd <- "dbpassword"
# loads the PostgreSQL driver
drv <- dbDriver("PostgreSQL")
# creates a connection to the postgres database
# note that "con" will be used later in each connection to the database
con <- dbConnect(
drv,
dbname = usr,
host = "db",
port = 5432,
user = usr,
password = pwd
)
dbExistsTable(con, "tab2")
dbWriteTable(
conn = con,
name = "tab2",
value = iris,
append = TRUE,
row.names = FALSE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.