blob: 275fb0e76e684a884905f8b13e94e7e5d6f7b2c2 [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 Kupietz289f9972023-10-09 09:49:12 +020036if (file.exists("/tmp/common.h")) {
37 source("/tmp/common.h")
38} else {
39 source("https://gitlab.ids-mannheim.de/ICC/2023-07-20-ICC-ICLC10/-/raw/master/R/common.R")
40}
Marc Kupietza737b1b2023-10-07 09:32:20 +020041```
42
43## R Markdown
44
Marc Kupietz3b217192023-10-08 20:56:36 +020045This 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 +020046
47When 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.
48
49## Slide with Bullets
50### Subheading
51
52- Bullet 1
53- Bullet 2
54- Bullet 3
55
56<aside class="notes">
57Here are some notes.
58</aside>
59
Marc Kupietza737b1b2023-10-07 09:32:20 +020060## Slide with R Output
61
62```{r cars, echo = TRUE}
63summary(cars)
64```
65
66## Slide with Plot
67
68```{r pressure}
69plot(pressure)
70```
71
Marc Kupietz2c094622023-10-08 14:19:47 +020072## Registered Users
73### (for COSMAS II and KorAP)
74
75```{r registrations, message=F, warning=F}
76registrierungen <-
77 read_tsv("http://www.ids-mannheim.de/cosmas2/projekt/intstats/registrierungen.csv") %>%
78 add_column(group = "registered users")
79
80 hc <- registrierungen %>%
81 hchart("line", hcaes(x=date, y=registered, group=group)) %>%
82 hc_add_theme(hc_theme_ids_light()) %>%
83 hc_yAxis(title=list(text="")) %>%
84 hc_xAxis(title=list(text="")) %>%
85 hc_legend(element_blank()) %>%
86 hc_size(height=500, width=900)
87 hc
88
89```
Marc Kupietzcf383442023-10-08 22:50:19 +020090
91## Light Verb Constructions
92### with *take* (from ICC-ENG)
93
94```{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."}
95take_ca_icc <-
96 collocationAnalysis(
97 icc_con("eng"),
98 "focus({[ud/l=take]} [ud/p=NOUN])",
99 leftContextSize = 0,
100 rightContextSize = 1,
101 minOccur = 2,
102 addExamples = T
103 ) %>% head(8)
104
105take_ca_icc %>% show_table()
106```
107
108## Source Code
109### Collocation Analysis
110
111```R
112 df <- collocationAnalysis(
113 icc_con("eng"),
114 "focus({[ud/l=take]} [ud/p=NOUN])",
115 leftContextSize = 0,
116 rightContextSize = 1,
117 minOccur = 2,
118 addExamples = T
119 )
120```
121
122## Source Code
123### Print Collocation Analysis as DataTable
124
125```R
126df %>%
127 mutate(Collocate=sprintf('<a href="%s">%s</a>',
128 webUIRequestUrl, collocate)) %>%
129 mutate(example=str_replace(example,
130 ".*(\\W+\\w+\\W+\\w+\\W+<mark.*/mark>.*)", "\\1")) %>%
131 mutate(example=str_replace(example,
132 "(.*<mark.*/mark>\\W+\\w+\\W+\\w+).*", "\\1")) %>%
133 rowwise() %>%
134 select(Collocate, Example, logDice, pmi, ll) %>%
135 datatable(escape = F) %>%
136 formatRound(columns=~logDice + pmi + ll, digits=2)
137```
138
Marc Kupietz3b217192023-10-08 20:56:36 +0200139# References
140