blob: 53c280dba30dbdec6b7045c1d9aaa067fd69270b [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:
Marc Kupietza737b1b2023-10-07 09:32:20 +02009 reveal_plugins:
10 - search
11 - zoom
12 - notes
13 - chalkboard
14 - menu
15 reveal_options:
Marc Kupietza737b1b2023-10-07 09:32:20 +020016 chalkboard:
17 theme: chalkboard
18 toggleNotesButton: true
19 menu:
20 numbers: true
Marc Kupietz3b217192023-10-08 20:56:36 +020021lang: en
22bibliography: references.bib
23csl: "https://raw.githubusercontent.com/ICLC-10/Zotero/master/styles/ICLC-10.csl"
Marc Kupietza737b1b2023-10-07 09:32:20 +020024---
25
26```{r setup, include=FALSE}
Marc Kupietz3b217192023-10-08 20:56:36 +020027knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE)
Marc Kupietz2c094622023-10-08 14:19:47 +020028library(idsThemeR)
Marc Kupietz289f9972023-10-09 09:49:12 +020029library(RKorAPClient)
Marc Kupietz2c094622023-10-08 14:19:47 +020030library(highcharter)
31library(tidyverse)
Marc Kupietz8a152592023-10-09 12:32:16 +020032source("https://gitlab.ids-mannheim.de/ICC/2023-07-20-ICC-ICLC10/-/raw/master/R/common.R")
Marc Kupietza737b1b2023-10-07 09:32:20 +020033```
34
35## R Markdown
36
Marc Kupietz3b217192023-10-08 20:56:36 +020037This 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 +020038
39When 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.
40
41## Slide with Bullets
42### Subheading
43
44- Bullet 1
45- Bullet 2
46- Bullet 3
47
48<aside class="notes">
49Here are some notes.
50</aside>
51
Marc Kupietza737b1b2023-10-07 09:32:20 +020052## Slide with R Output
53
54```{r cars, echo = TRUE}
55summary(cars)
56```
57
58## Slide with Plot
59
60```{r pressure}
61plot(pressure)
62```
63
Marc Kupietz2c094622023-10-08 14:19:47 +020064## Registered Users
65### (for COSMAS II and KorAP)
66
67```{r registrations, message=F, warning=F}
68registrierungen <-
69 read_tsv("http://www.ids-mannheim.de/cosmas2/projekt/intstats/registrierungen.csv") %>%
70 add_column(group = "registered users")
71
72 hc <- registrierungen %>%
73 hchart("line", hcaes(x=date, y=registered, group=group)) %>%
74 hc_add_theme(hc_theme_ids_light()) %>%
75 hc_yAxis(title=list(text="")) %>%
76 hc_xAxis(title=list(text="")) %>%
77 hc_legend(element_blank()) %>%
78 hc_size(height=500, width=900)
79 hc
80
81```
Marc Kupietzcf383442023-10-08 22:50:19 +020082
83## Light Verb Constructions
84### with *take* (from ICC-ENG)
85
86```{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."}
87take_ca_icc <-
88 collocationAnalysis(
89 icc_con("eng"),
90 "focus({[ud/l=take]} [ud/p=NOUN])",
91 leftContextSize = 0,
92 rightContextSize = 1,
93 minOccur = 2,
94 addExamples = T
Marc Kupietz8a152592023-10-09 12:32:16 +020095 ) %>% head(7)
Marc Kupietzcf383442023-10-08 22:50:19 +020096
97take_ca_icc %>% show_table()
98```
99
100## Source Code
101### Collocation Analysis
102
103```R
104 df <- collocationAnalysis(
105 icc_con("eng"),
106 "focus({[ud/l=take]} [ud/p=NOUN])",
107 leftContextSize = 0,
108 rightContextSize = 1,
109 minOccur = 2,
110 addExamples = T
111 )
112```
113
114## Source Code
115### Print Collocation Analysis as DataTable
116
117```R
118df %>%
119 mutate(Collocate=sprintf('<a href="%s">%s</a>',
120 webUIRequestUrl, collocate)) %>%
121 mutate(example=str_replace(example,
122 ".*(\\W+\\w+\\W+\\w+\\W+<mark.*/mark>.*)", "\\1")) %>%
123 mutate(example=str_replace(example,
124 "(.*<mark.*/mark>\\W+\\w+\\W+\\w+).*", "\\1")) %>%
125 rowwise() %>%
126 select(Collocate, Example, logDice, pmi, ll) %>%
127 datatable(escape = F) %>%
128 formatRound(columns=~logDice + pmi + ll, digits=2)
129```
130
Marc Kupietz3b217192023-10-08 20:56:36 +0200131# References
132