Marc Kupietz | 08d222b | 2020-01-16 09:19:08 +0100 | [diff] [blame] | 1 | library(RKorAPClient) |
Marc Kupietz | 08d222b | 2020-01-16 09:19:08 +0100 | [diff] [blame] | 2 | |
| 3 | plotHighchart <- 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 | |
| 15 | saveHCPlot <- 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)) |
| 20 | h1 <- 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 Kupietz | 91145b0 | 2020-01-29 15:58:36 +0100 | [diff] [blame^] | 23 | |