blob: 4d312ba1e30b17881b317434d328c96baebe7ba7 [file] [log] [blame]
Marc Kupietz08d222b2020-01-16 09:19:08 +01001library(RKorAPClient)
Marc Kupietz08d222b2020-01-16 09:19:08 +01002
3plotHighchart <- function(query = "Schlumpf",
4 years = c(2000:2010),
5 as.alternatives = length(query) > 1,
6 vc = "textType = /Zeit.*/ & availability!=QAO-NC-LOC:ids & pubDate in",
7 kco = new("KorAPConnection", verbose=T) ) {
8 hc <-
9 frequencyQuery(kco, query, paste(vc, years), as.alternatives=as.alternatives) %>%
10 hc_freq_by_year_ci(as.alternatives)
11 print(hc)
12 hc
13}
14
15saveHCPlot <- function(hc, fname) {
16 htmlwidgets::saveWidget(hc, file=fname, selfcontained = T)
17}
18
19#h1 <-plotHighchart(c("macht []{0,3} Sinn", "ergibt []{0,3} Sinn"), c(1980:2018))
20h1 <- plotHighchart(c("Leser | Lesern | Lesers", 'Leserin | Leserinnen', 'LeserIn | LeserInnen', '"Leser[_\\*]in.*"'), c(1985:2018), as.alternatives = F)
21#plotHighchart(c("Tollpatsch", "Tolpatsch"), c(1991:2018))
22
Marc Kupietz91145b02020-01-29 15:58:36 +010023