blob: 6e1a2a1693df88f0878078b4bc78b6b70d5d236e [file] [log] [blame]
Marc Kupietza737b1b2023-10-07 09:32:20 +02001---
Marc Kupietzdf0eda92023-10-07 20:50:00 +02002title: "IDS theme for revealjs"
3subtitle: "a demo"
Marc Kupietza737b1b2023-10-07 09:32:20 +02004author: Marc Kupietz
5institute: "IDS Mannheim"
Marc Kupietz2c094622023-10-08 14:19:47 +02006date: "Mannheim, 2023-10-08"
Marc Kupietza737b1b2023-10-07 09:32:20 +02007output:
8 revealjs::revealjs_presentation:
9 theme: ids
10 highlight: pygments
11 self_contained: false
12 reveal_plugins:
13 - search
14 - zoom
15 - notes
16 - chalkboard
17 - menu
18 reveal_options:
Marc Kupietz7c8f7de2023-10-07 11:42:29 +020019 slideNumber: true
Marc Kupietza737b1b2023-10-07 09:32:20 +020020 chalkboard:
21 theme: chalkboard
22 toggleNotesButton: true
23 menu:
24 numbers: true
Marc Kupietz3b217192023-10-08 20:56:36 +020025lang: en
26bibliography: references.bib
27csl: "https://raw.githubusercontent.com/ICLC-10/Zotero/master/styles/ICLC-10.csl"
Marc Kupietza737b1b2023-10-07 09:32:20 +020028---
29
30```{r setup, include=FALSE}
Marc Kupietz3b217192023-10-08 20:56:36 +020031knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE)
Marc Kupietz2c094622023-10-08 14:19:47 +020032library(idsThemeR)
Marc Kupietz289f9972023-10-09 09:49:12 +020033library(RKorAPClient)
Marc Kupietz2c094622023-10-08 14:19:47 +020034library(highcharter)
35library(tidyverse)
Marc Kupietz8a152592023-10-09 12:32:16 +020036source("https://gitlab.ids-mannheim.de/ICC/2023-07-20-ICC-ICLC10/-/raw/master/R/common.R")
Marc Kupietza737b1b2023-10-07 09:32:20 +020037```
38
39## R Markdown
40
Marc Kupietz3b217192023-10-08 20:56:36 +020041This is an R Markdown presentation. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown [@R-rmarkdown] see <http://rmarkdown.rstudio.com>.
Marc Kupietza737b1b2023-10-07 09:32:20 +020042
43When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document.
44
45## Slide with Bullets
46### Subheading
47
48- Bullet 1
49- Bullet 2
50- Bullet 3
51
52<aside class="notes">
53Here are some notes.
54</aside>
55
Marc Kupietza737b1b2023-10-07 09:32:20 +020056## Slide with R Output
57
58```{r cars, echo = TRUE}
59summary(cars)
60```
61
62## Slide with Plot
63
64```{r pressure}
65plot(pressure)
66```
67
Marc Kupietz2c094622023-10-08 14:19:47 +020068## Registered Users
69### (for COSMAS II and KorAP)
70
71```{r registrations, message=F, warning=F}
72registrierungen <-
73 read_tsv("http://www.ids-mannheim.de/cosmas2/projekt/intstats/registrierungen.csv") %>%
74 add_column(group = "registered users")
75
76 hc <- registrierungen %>%
77 hchart("line", hcaes(x=date, y=registered, group=group)) %>%
78 hc_add_theme(hc_theme_ids_light()) %>%
79 hc_yAxis(title=list(text="")) %>%
80 hc_xAxis(title=list(text="")) %>%
81 hc_legend(element_blank()) %>%
82 hc_size(height=500, width=900)
83 hc
84
85```
Marc Kupietzcf383442023-10-08 22:50:19 +020086
87## Light Verb Constructions
88### with *take* (from ICC-ENG)
89
90```{r take-icc, fig.cap="Results of a co-occurrence analysis of *take* + NOUN in [ICC-ENG](https://korap.ids-mannheim.de/instance/icc), using the RKorAPClient [@kupietz_rkorapclient_2020] package."}
91take_ca_icc <-
92 collocationAnalysis(
93 icc_con("eng"),
94 "focus({[ud/l=take]} [ud/p=NOUN])",
95 leftContextSize = 0,
96 rightContextSize = 1,
97 minOccur = 2,
98 addExamples = T
Marc Kupietz8a152592023-10-09 12:32:16 +020099 ) %>% head(7)
Marc Kupietzcf383442023-10-08 22:50:19 +0200100
101take_ca_icc %>% show_table()
102```
103
104## Source Code
105### Collocation Analysis
106
107```R
108 df <- collocationAnalysis(
109 icc_con("eng"),
110 "focus({[ud/l=take]} [ud/p=NOUN])",
111 leftContextSize = 0,
112 rightContextSize = 1,
113 minOccur = 2,
114 addExamples = T
115 )
116```
117
118## Source Code
119### Print Collocation Analysis as DataTable
120
121```R
122df %>%
123 mutate(Collocate=sprintf('<a href="%s">%s</a>',
124 webUIRequestUrl, collocate)) %>%
125 mutate(example=str_replace(example,
126 ".*(\\W+\\w+\\W+\\w+\\W+<mark.*/mark>.*)", "\\1")) %>%
127 mutate(example=str_replace(example,
128 "(.*<mark.*/mark>\\W+\\w+\\W+\\w+).*", "\\1")) %>%
129 rowwise() %>%
130 select(Collocate, Example, logDice, pmi, ll) %>%
131 datatable(escape = F) %>%
132 formatRound(columns=~logDice + pmi + ll, digits=2)
133```
134
Marc Kupietz3b217192023-10-08 20:56:36 +0200135# References
136