blob: 77932fb3e9c4ff37044c38c66a4942403c901643 [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 Kupietzea8ff772024-05-14 22:08:46 +02004author:
5 - name: Marc Kupietz
6 - name: John Doe
Marc Kupietza737b1b2023-10-07 09:32:20 +02007institute: "IDS Mannheim"
Marc Kupietz7df5e692023-10-10 21:49:17 +02008date: "`r paste0('Mannheim, ', Sys.Date())`"
Marc Kupietza737b1b2023-10-07 09:32:20 +02009output:
10 revealjs::revealjs_presentation:
Marc Kupietza737b1b2023-10-07 09:32:20 +020011 reveal_plugins:
12 - search
13 - zoom
14 - notes
Marc Kupietza737b1b2023-10-07 09:32:20 +020015 - menu
16 reveal_options:
Marc Kupietza737b1b2023-10-07 09:32:20 +020017 chalkboard:
18 theme: chalkboard
19 toggleNotesButton: true
20 menu:
21 numbers: true
Marc Kupietz3b217192023-10-08 20:56:36 +020022lang: en
23bibliography: references.bib
24csl: "https://raw.githubusercontent.com/ICLC-10/Zotero/master/styles/ICLC-10.csl"
Marc Kupietza737b1b2023-10-07 09:32:20 +020025---
26
27```{r setup, include=FALSE}
Marc Kupietz3b217192023-10-08 20:56:36 +020028knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE)
Marc Kupietz2c094622023-10-08 14:19:47 +020029library(idsThemeR)
Marc Kupietz289f9972023-10-09 09:49:12 +020030library(RKorAPClient)
Marc Kupietz2c094622023-10-08 14:19:47 +020031library(highcharter)
32library(tidyverse)
Marc Kupietz8a152592023-10-09 12:32:16 +020033source("https://gitlab.ids-mannheim.de/ICC/2023-07-20-ICC-ICLC10/-/raw/master/R/common.R")
Marc Kupietza737b1b2023-10-07 09:32:20 +020034```
Marc Kupietz51152512023-10-09 23:18:10 +020035# Introduction
Marc Kupietza737b1b2023-10-07 09:32:20 +020036
37## R Markdown
38
Marc Kupietz3b217192023-10-08 20:56:36 +020039This 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 +020040
41When 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.
42
43## Slide with Bullets
44### Subheading
45
46- Bullet 1
47- Bullet 2
48- Bullet 3
49
50<aside class="notes">
51Here are some notes.
52</aside>
53
Marc Kupietz51152512023-10-09 23:18:10 +020054# Methods
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 Kupietz51152512023-10-09 23:18:10 +020068# Results
69
Marc Kupietz2c094622023-10-08 14:19:47 +020070## Registered Users
Marc Kupietz51152512023-10-09 23:18:10 +020071### for COSMAS II and KorAP
Marc Kupietz2c094622023-10-08 14:19:47 +020072
73```{r registrations, message=F, warning=F}
74registrierungen <-
75 read_tsv("http://www.ids-mannheim.de/cosmas2/projekt/intstats/registrierungen.csv") %>%
76 add_column(group = "registered users")
77
78 hc <- registrierungen %>%
79 hchart("line", hcaes(x=date, y=registered, group=group)) %>%
80 hc_add_theme(hc_theme_ids_light()) %>%
81 hc_yAxis(title=list(text="")) %>%
82 hc_xAxis(title=list(text="")) %>%
83 hc_legend(element_blank()) %>%
Marc Kupietz62c72832024-05-14 22:08:15 +020084 hc_size(height=500, width=1260)
Marc Kupietz2c094622023-10-08 14:19:47 +020085 hc
86
87```
Marc Kupietzcf383442023-10-08 22:50:19 +020088
89## Light Verb Constructions
Marc Kupietz51152512023-10-09 23:18:10 +020090### with *take* in ICC-English
Marc Kupietzcf383442023-10-08 22:50:19 +020091
Marc Kupietzd8ddefb2026-05-04 19:41:45 +020092```{r take-icc, fig.cap="Collocation analysis results for *take* + NOUN in [English Wikipedia](https://korap.ids-mannheim.de/instance/english), using the RKorAPClient [@kupietz_rkorapclient_2020] package."}
Marc Kupietzcf383442023-10-08 22:50:19 +020093take_ca_icc <-
Marc Kupietzd8ddefb2026-05-04 19:41:45 +020094 KorAPConnection(("https://korap.ids-mannheim.de/instance/english/")) %>%
Marc Kupietzcf383442023-10-08 22:50:19 +020095 collocationAnalysis(
Marc Kupietzd8ddefb2026-05-04 19:41:45 +020096 "focus({[tt/l=take]} [tt/p=NOUN])",
Marc Kupietzcf383442023-10-08 22:50:19 +020097 leftContextSize = 0,
98 rightContextSize = 1,
Marc Kupietzcf383442023-10-08 22:50:19 +020099 addExamples = T
Marc Kupietz8a152592023-10-09 12:32:16 +0200100 ) %>% head(7)
Marc Kupietzcf383442023-10-08 22:50:19 +0200101
102take_ca_icc %>% show_table()
103```
104
105## Source Code
106### Collocation Analysis
107
108```R
109 df <- collocationAnalysis(
110 icc_con("eng"),
111 "focus({[ud/l=take]} [ud/p=NOUN])",
112 leftContextSize = 0,
113 rightContextSize = 1,
114 minOccur = 2,
115 addExamples = T
116 )
117```
118
119## Source Code
120### Print Collocation Analysis as DataTable
121
122```R
123df %>%
Marc Kupietzd8ddefb2026-05-04 19:41:45 +0200124 mutate(Collocate=sprintf('<a href="%s">%s</a>', webUIRequestUrl, collocate)) %>%
Marc Kupietzcf383442023-10-08 22:50:19 +0200125 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```
Marc Kupietz3b217192023-10-08 20:56:36 +0200134# References
135
Marc Kupietz51152512023-10-09 23:18:10 +0200136## References
137