blob: c56120ec4f729d3edf8b85d8366ddb28d5b47dc2 [file] [log] [blame]
Marc Kupietzcd7acbd2020-12-10 14:02:52 +01001library(RKorAPClient)
2library(highcharter)
3library(idsThemeR)
4
5df <- new("KorAPConnection", verbose = TRUE) %>%
6 frequencyQuery("sozusagen/i", vc = c("corpusSigle=FOLK", "corpusSigle!=FOLK")) %>%
7 ipm() %>%
8 mutate(corpus = c("FOLK", "DeReKo"))
9
10hc <- 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) %>%
29 hc_title(text = "Frequency of 'sozusagen' in FOLK (excerpt) vs. DeReKo")
30
31
32print(hc)