Add demo for retrieving book titles from DeLiKo@DNB
Change-Id: I96fcdf0593fe5e8e8b29ba70b9c08d1a62f72a80
diff --git a/demo/00Index b/demo/00Index
index 8a1200f..537de21 100644
--- a/demo/00Index
+++ b/demo/00Index
@@ -16,3 +16,4 @@
pluralGenderVariants Plot frequencies of the plural gender variants of a word in the core corpus of the Council for German Orthography (OKK) over time.
adjectiveCollocates Shows adjective collocates of 'Gendern'.
relativeTextpositionBoxplot Plot the relative text positions of a some adverbs as highcharter boxplot.
+retrieveTitlesFromDeliko Retrieves and shows all titles from novels of a chosen genre in the DeLiKo@DNB German fiction corpus.
diff --git a/demo/retrieveTitlesFromDeliko.R b/demo/retrieveTitlesFromDeliko.R
new file mode 100644
index 0000000..800ee01
--- /dev/null
+++ b/demo/retrieveTitlesFromDeliko.R
@@ -0,0 +1,29 @@
+library(RKorAPClient)
+library(tidyverse)
+
+VC = "textTypeRef = /Arzt.*/" # virtual corpus with just doctor novels etc.
+
+query <- KorAPConnection("https://korap.dnb.de", verbose = TRUE) |>
+ corpusQuery(
+ "<base/s=t>", # this finds each text once
+ vc = VC,
+ fields = c(
+ "textSigle",
+ "title",
+ "subTitle"
+ # "author",
+ # "textType",
+ # "textTypeRef",
+ # "publisher",
+ # "pubDate",
+ # "pubPlace",
+ # "ISBN",
+ # "URN"
+ )
+ ) |>
+ fetchAll()
+
+df <- query@collectedMatches |>
+ select(-c("matchStart", "matchEnd"))
+
+View(df)