Description Usage Arguments Value Examples
View source: R/nycflights13-sql.R
Using the connection given in con
, create a database including a few tables
from the nycflights13
dataset.
1 | nycflights13_create_sql(con, schema = "", ...)
|
con |
an SQL connection (i.e a PostgreSQL connection) |
schema |
schema to write the tables ("", or no schema by default) |
... |
additional parameters to connect to a database |
the connection given in con
invisibly, generally called for the
side effects of writing to the database
1 2 3 4 5 6 7 8 9 10 11 12 | if (check_for_pkg("RSQLite", message)) {
con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
nycflights13_create_sql(con)
DBI::dbGetQuery(
con,
"SELECT year, month, day, carrier, flight, tailnum FROM flights LIMIT 10"
)
DBI::dbDisconnect(con)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.