R access SQLite
Necessary Packages
install.packages("Rcpp")
install.packages("sqldf")
install.packages("XLConnect")
library(sqldf)
db <- dbConnect(SQLite(), dbname="ht.sqlite")
allTables = dbListTables(db)
for(i in 1:length(allTables)) {
tryCatch({
data <- dbReadTable(db, allTables[i])
write.table(data, file = paste(allTables[i],"csv",sep="."),
append = FALSE, quote = FALSE, sep = ",",
eol = "\n", na = "NA", dec = ".", row.names = FALSE,
col.names = FALSE, qmethod = c("escape", "double"),
fileEncoding = "")
}, error = function(e) {
print(allTables[i])
})
}