We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 23cc496 commit 76ee94dCopy full SHA for 76ee94d
1 file changed
inst/extdata/read_sqlite_file.R
@@ -0,0 +1,28 @@
1
+#
2
+# description: This script opens a database connection to a file in SQLite
3
+# format, lists the tables and reads the table contents into a list.
4
5
+# author: Hauke Sonnenberg
6
+# created: 2020-02-18
7
8
+
9
+#install.packages("RSQLite")
10
+library(DBI)
11
12
+# Create an ephemeral in-memory RSQLite database
13
+#con <- dbConnect(RSQLite::SQLite(), "~/Projekte2/dms/pdb.eni")
14
+con <- dbConnect(RSQLite::SQLite(), "~/Projekte2/dms/sdb.eni")
15
16
+table_names <- dbListTables(con)
17
18
+contents <- lapply(setNames(nm = table_names), dbReadTable, con = con)
19
20
+str(contents, 2)
21
22
+x <- contents$refs[, c("id", "keywords")]
23
24
+View(x)
25
26
+#write.csv(x, "keywords.csv", row.names = FALSE)
27
28
+dbDisconnect(con)
0 commit comments