Set up and connect to an sqlite database using R.
Here's some basic syntax
library(RSQLite)
# row names are not stored in the DB
# that's why we add an extra column here
mtcars$name <- row.names(mtcars)
db_path = "data/h4sci.sqlite3"
con <- dbConnect(RSQLite::SQLite(), db_path)
dbWriteTable(con, dbQuoteIdentifier(con,"mtcars"), mtcars)
# Only do this when you're done playing
dbDisconnect(con)
Add your favorite dataset from the fivethirtyeight package to that database.
Evaluate the following statement critically:
"If your data fits in memory there is no advantage to putting it in a database: it will only be slower and more frustrating."
-- taken from the {dbplyr} documentation
Set up and connect to an
sqlitedatabase using R.Here's some basic syntax
Add your favorite dataset from the
fivethirtyeightpackage to that database.Evaluate the following statement critically: