Description
There are a few places that could use a better description of the code being run:
-
line 79
results <- dbSendQuery(mydb, "SELECT * FROM Question1") -
lines 156-165
dbfile_new = "a_newdb.sqlite"
mydb_new = dbConnect(dbDriver("SQLite"), dbfile_new)
dbWriteTable(conn = mydb_new , name = "SN7577", value = "SN7577.csv",
row.names = FALSE, header = TRUE)
dbWriteTable(conn = mydb_new , name = "Q1", value = Q1,
row.names = FALSE)
dbListTables(mydb_new)
- line 180
tbl(mydb_dplyr, sql("SELECT count(*) from SN7577"))
Add details re: line 104 - why should the connection be closed? Does it need to be reopened to run code in following chunks?
"Once you have retrieved the data you should close the connection."
Clarify lines 177 and 202 - unsure what they are trying to say
"as is the mthod for running queries. However using the 'tbl' functionwe still need to provide avalid SQL string."
"Notice that on the nrow
command we get NA rather than a count of rows. Thisis because dplyr
doesn't hold the full table even after the 'Select * ...' "