Add demo for comparing written vs. spoken frequencies
Change-Id: I9416c8b199c64e55e10d40db0e475cf6de488b40
diff --git a/demo/00Index b/demo/00Index
index 117e857..f2e526a 100644
--- a/demo/00Index
+++ b/demo/00Index
@@ -5,3 +5,4 @@
regional Map plot regional frequencies of query expression
mosaicplot Visualize frequencies of alternative query terms in relation to other variables
highcharter-example Visualize frqequencies of optionally alternative terms over time with interactive HTML and JavaScript elements using the package highcharter as wrapper for Highcharts
+writtenVsSpoken Compare frequencies in written vs. spoken corpora
diff --git a/demo/writtenVsSpoken.R b/demo/writtenVsSpoken.R
new file mode 100644
index 0000000..6e63399
--- /dev/null
+++ b/demo/writtenVsSpoken.R
@@ -0,0 +1,13 @@
+# library(devtools)
+# install_github("KorAP/RKorAPClient")
+library(RKorAPClient)
+library(ggplot2)
+g <- new("KorAPConnection", verbose=T) %>%
+ frequencyQuery("sozusagen/i", vc=c("corpusSigle=FOLK", "corpusSigle!=FOLK")) %>%
+ ipm() %>%
+ mutate(corpus=c("FOLK", "DeReKo")) %>%
+ ggplot(aes(x = corpus, y = ipm, ymin = conf.low, ymax = conf.high)) +
+ geom_col() +
+ geom_errorbar(width = .3, alpha = .3) +
+ ggtitle("'sozusagen' in written (DeReKo) and spoken corpora (FOLK-excerpt)")
+print(g)