createF1db | R Documentation |
Creates a local 'DuckDB' or 'SQLite' database using the latest 'Ergast' data and establish a connection.
createF1db(csv_dir = NULL, rm_csv = FALSE, type = "duckdb")
csv_dir |
either NULL or the name of a directory containing csv files from Ergast. If NULL, the files will be downloaded and placed in a directory within the working directory named "/f1db_csv" |
rm_csv |
logical indicating whether the csv directory should be deleted after initializing the database |
type |
"duckdb" or "sqlite" |
createF1db()
creates a local 'DuckDB' or 'SQLite' database using csv files downloaded from Ergast.
The database will be located in a file 'f1_db.duckdb' 'f1_db.sqlite' within the working directory.
Databases created with this function can be interacted with using functions from the 'DBI' Package. You can also use the convenience function F1dbConnect
to reconnect to a database created by createF1db
an object of class duckdb_connection
or SQLiteConnection
library(DBI)
con <- createF1db()
dbListTables(con)
dbDisconnect(con)
unlink("f1_db.duckdb")
unlink('f1db_csv', recursive = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.