Process of connecting to SQLite database and executing commands and readings goes like this.
library(RSQLite)
db <- dbConnect(RSQLite::SQLite, "path for db file")
dbExecute(db, "SQL command")
response <- dbGetQuery(db, "SQL command")
dbDisconnect(db)
In first line, we are importing RSQLite package. In second line db connection structure is created using dbConnect function where we are going to provide two arguments; first argument is RSQLite::SQLite and second is path to database file. In third line is example of how command execution works; first argument is database structure and second is actual database query. In fourth line is example of query that should return database readings; here is the same case in regards of arguments; first argument is database connection structure, and second line is sql select statement. Purpose of final line is to close database connection where database structure is provided as the only argument.
For video tutorial, check the link below.