Marc Kupietz | cd7acbd | 2020-12-10 14:02:52 +0100 | [diff] [blame] | 1 | library(RKorAPClient) |
| 2 | library(highcharter) |
| 3 | library(idsThemeR) |
| 4 | |
| 5 | df <- new("KorAPConnection", verbose = TRUE) %>% |
| 6 | frequencyQuery("sozusagen/i", vc = c("corpusSigle=FOLK", "corpusSigle!=FOLK")) %>% |
| 7 | ipm() %>% |
| 8 | mutate(corpus = c("FOLK", "DeReKo")) |
| 9 | |
| 10 | hc <- highchart() %>% |
| 11 | hc_add_theme(hc_theme_ids_light()) %>% |
| 12 | hc_add_series(type = "column", data = df, hcaes(corpus, ipm)) %>% |
| 13 | hc_add_series( |
| 14 | data = df, |
| 15 | hcaes( |
| 16 | x = corpus, |
| 17 | y = ipm, |
| 18 | low = conf.low, |
| 19 | high = conf.high |
| 20 | ), |
| 21 | type = "errorbar", |
| 22 | stemWidth = 2, |
| 23 | whiskerWidth = 2, |
| 24 | whiskerLength = 30 |
| 25 | ) %>% |
| 26 | hc_yAxis(title=list(text="IPM")) %>% |
| 27 | hc_xAxis(categories = c("FOLK-excerpt", "DeReKo")) %>% |
| 28 | hc_legend(enabled = FALSE) %>% |
Marc Kupietz | a28a3f8 | 2023-11-15 10:03:27 +0100 | [diff] [blame^] | 29 | hc_title(text = "Frequency of 'sozusagen' in FOLK (excerpt) vs. DeReKo") %>% |
| 30 | hc_add_onclick_korap_search() |
Marc Kupietz | cd7acbd | 2020-12-10 14:02:52 +0100 | [diff] [blame] | 31 | |
| 32 | |
| 33 | print(hc) |