The steps for this recipe are as as follows:
- Load the RSQLite library.
- Create an object by calling up the SQLite database driver.
- Create a connection string with the database engine and R session. The database will be created in this same step.
- Create a data table and insert actual data from the mtcars dataset.
- Extract only those rows containing automatic transmission cars with the variable "am" ==0.
- Display the first few rows of the extracted dataset.
- Disconnect the database driver.
- Disconnect the database.
The code to perform the preceding tasks is as follows:
library(RSQLite) dbDriverSQLite <- dbDriver("SQLite") dbNew <- dbConnect(drv = dbDriverSQLite, dbname="testdbSQL") carTable <- dbWriteTable(con = dbNew, name = ...