Add demo for comparing written vs. spoken frequencies
Change-Id: I9416c8b199c64e55e10d40db0e475cf6de488b40
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)