blob: b6167f729abe15f0e738cb4ed5835ba647df2820 [file] [log] [blame]
Marc Kupietz08d222b2020-01-16 09:19:08 +01001library(RKorAPClient)
Marc Kupietz07deae02021-03-05 12:15:07 +01002library(htmlwidgets)
Marc Kupietz08d222b2020-01-16 09:19:08 +01003
4plotHighchart <- function(query = "Schlumpf",
5 years = c(2000:2010),
6 as.alternatives = length(query) > 1,
7 vc = "textType = /Zeit.*/ & availability!=QAO-NC-LOC:ids & pubDate in",
Marc Kupietzcf1771d2020-03-04 16:03:04 +01008 kco = new("KorAPConnection", verbose=TRUE) ) {
Marc Kupietz08d222b2020-01-16 09:19:08 +01009 hc <-
10 frequencyQuery(kco, query, paste(vc, years), as.alternatives=as.alternatives) %>%
11 hc_freq_by_year_ci(as.alternatives)
12 print(hc)
13 hc
14}
15
16saveHCPlot <- function(hc, fname) {
Marc Kupietzcf1771d2020-03-04 16:03:04 +010017 htmlwidgets::saveWidget(hc, file=fname, selfcontained = TRUE)
Marc Kupietz08d222b2020-01-16 09:19:08 +010018}
19
20#h1 <-plotHighchart(c("macht []{0,3} Sinn", "ergibt []{0,3} Sinn"), c(1980:2018))
Marc Kupietzcf1771d2020-03-04 16:03:04 +010021h1 <- plotHighchart(c("Leser | Lesern | Lesers", 'Leserin | Leserinnen', 'LeserIn | LeserInnen', '"Leser[_\\*]in.*"'), c(1985:2018), as.alternatives = FALSE)
Marc Kupietz08d222b2020-01-16 09:19:08 +010022#plotHighchart(c("Tollpatsch", "Tolpatsch"), c(1991:2018))
23
Marc Kupietz91145b02020-01-29 15:58:36 +010024