blob: e2947ea45de754c7226d35af3af0167c982ec1b7 [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",
Marc Kupietzcf1771d2020-03-04 16:03:04 +01007 kco = new("KorAPConnection", verbose=TRUE) ) {
Marc Kupietz08d222b2020-01-16 09:19:08 +01008 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) {
Marc Kupietzcf1771d2020-03-04 16:03:04 +010016 htmlwidgets::saveWidget(hc, file=fname, selfcontained = TRUE)
Marc Kupietz08d222b2020-01-16 09:19:08 +010017}
18
19#h1 <-plotHighchart(c("macht []{0,3} Sinn", "ergibt []{0,3} Sinn"), c(1980:2018))
Marc Kupietzcf1771d2020-03-04 16:03:04 +010020h1 <- plotHighchart(c("Leser | Lesern | Lesers", 'Leserin | Leserinnen', 'LeserIn | LeserInnen', '"Leser[_\\*]in.*"'), c(1985:2018), as.alternatives = FALSE)
Marc Kupietz08d222b2020-01-16 09:19:08 +010021#plotHighchart(c("Tollpatsch", "Tolpatsch"), c(1991:2018))
22
Marc Kupietz91145b02020-01-29 15:58:36 +010023