| Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 1 | --- |
| Marc Kupietz | df0eda9 | 2023-10-07 20:50:00 +0200 | [diff] [blame] | 2 | title: "IDS theme for revealjs" |
| 3 | subtitle: "a demo" |
| Marc Kupietz | ea8ff77 | 2024-05-14 22:08:46 +0200 | [diff] [blame] | 4 | author: |
| 5 | - name: Marc Kupietz |
| 6 | - name: John Doe |
| Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 7 | institute: "IDS Mannheim" |
| Marc Kupietz | 7df5e69 | 2023-10-10 21:49:17 +0200 | [diff] [blame] | 8 | date: "`r paste0('Mannheim, ', Sys.Date())`" |
| Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 9 | output: |
| Marc Kupietz | e195cea | 2026-08-17 13:17:33 +0200 | [diff] [blame] | 10 | revealjs.ids::revealjs_presentation: |
| Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 11 | reveal_plugins: |
| 12 | - search |
| 13 | - zoom |
| 14 | - notes |
| Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 15 | - menu |
| 16 | reveal_options: |
| Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 17 | chalkboard: |
| 18 | theme: chalkboard |
| 19 | toggleNotesButton: true |
| 20 | menu: |
| 21 | numbers: true |
| Marc Kupietz | 3b21719 | 2023-10-08 20:56:36 +0200 | [diff] [blame] | 22 | lang: en |
| 23 | bibliography: references.bib |
| Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 24 | --- |
| 25 | |
| 26 | ```{r setup, include=FALSE} |
| Marc Kupietz | 3b21719 | 2023-10-08 20:56:36 +0200 | [diff] [blame] | 27 | knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE) |
| Marc Kupietz | 2c09462 | 2023-10-08 14:19:47 +0200 | [diff] [blame] | 28 | library(idsThemeR) |
| Marc Kupietz | 289f997 | 2023-10-09 09:49:12 +0200 | [diff] [blame] | 29 | library(RKorAPClient) |
| Marc Kupietz | 2c09462 | 2023-10-08 14:19:47 +0200 | [diff] [blame] | 30 | library(highcharter) |
| 31 | library(tidyverse) |
| Marc Kupietz | 8a15259 | 2023-10-09 12:32:16 +0200 | [diff] [blame] | 32 | source("https://gitlab.ids-mannheim.de/ICC/2023-07-20-ICC-ICLC10/-/raw/master/R/common.R") |
| Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 33 | ``` |
| Marc Kupietz | 5115251 | 2023-10-09 23:18:10 +0200 | [diff] [blame] | 34 | # Introduction |
| Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 35 | |
| 36 | ## R Markdown |
| 37 | |
| Marc Kupietz | 3b21719 | 2023-10-08 20:56:36 +0200 | [diff] [blame] | 38 | This 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 Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 39 | |
| 40 | When 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. |
| 41 | |
| 42 | ## Slide with Bullets |
| 43 | ### Subheading |
| 44 | |
| 45 | - Bullet 1 |
| 46 | - Bullet 2 |
| Marc Kupietz | 281ba9c | 2026-08-11 15:37:48 +0200 | [diff] [blame] | 47 | - Second-level bullet |
| 48 | - Second-level bullet |
| 49 | - Third-level bullet |
| 50 | - Third-level bullet |
| Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 51 | - Bullet 3 |
| 52 | |
| 53 | <aside class="notes"> |
| 54 | Here are some notes. |
| 55 | </aside> |
| 56 | |
| Marc Kupietz | 5115251 | 2023-10-09 23:18:10 +0200 | [diff] [blame] | 57 | # Methods |
| 58 | |
| Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 59 | ## Slide with R Output |
| 60 | |
| 61 | ```{r cars, echo = TRUE} |
| 62 | summary(cars) |
| 63 | ``` |
| 64 | |
| 65 | ## Slide with Plot |
| 66 | |
| Marc Kupietz | beefb62 | 2026-08-08 17:17:07 +0200 | [diff] [blame] | 67 | ```{r pressure, fig.height=5, fig.width=12, message=F, warning=F} |
| Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 68 | plot(pressure) |
| 69 | ``` |
| 70 | |
| Marc Kupietz | 5115251 | 2023-10-09 23:18:10 +0200 | [diff] [blame] | 71 | # Results |
| 72 | |
| Marc Kupietz | 2c09462 | 2023-10-08 14:19:47 +0200 | [diff] [blame] | 73 | ## Registered Users |
| Marc Kupietz | 5115251 | 2023-10-09 23:18:10 +0200 | [diff] [blame] | 74 | ### for COSMAS II and KorAP |
| Marc Kupietz | 2c09462 | 2023-10-08 14:19:47 +0200 | [diff] [blame] | 75 | |
| 76 | ```{r registrations, message=F, warning=F} |
| 77 | registrierungen <- |
| 78 | read_tsv("http://www.ids-mannheim.de/cosmas2/projekt/intstats/registrierungen.csv") %>% |
| 79 | add_column(group = "registered users") |
| 80 | |
| Marc Kupietz | beefb62 | 2026-08-08 17:17:07 +0200 | [diff] [blame] | 81 | hc <- registrierungen %>% |
| 82 | hchart("line", hcaes(x = date, y = registered, group = group)) %>% |
| 83 | hc_add_theme(hc_theme_ids_light()) %>% |
| 84 | hc_yAxis(title = list(text = "")) %>% |
| 85 | hc_xAxis(title = list(text = "")) %>% |
| 86 | hc_legend(element_blank()) %>% |
| Marc Kupietz | 65e231f | 2026-08-28 09:19:18 +0300 | [diff] [blame^] | 87 | hc_size(height = 500, width = 1160) |
| Marc Kupietz | beefb62 | 2026-08-08 17:17:07 +0200 | [diff] [blame] | 88 | hc |
| Marc Kupietz | 2c09462 | 2023-10-08 14:19:47 +0200 | [diff] [blame] | 89 | ``` |
| Marc Kupietz | cf38344 | 2023-10-08 22:50:19 +0200 | [diff] [blame] | 90 | |
| Marc Kupietz | cf38344 | 2023-10-08 22:50:19 +0200 | [diff] [blame] | 91 | |
| 92 | ## Source Code |
| 93 | ### Collocation Analysis |
| 94 | |
| 95 | ```R |
| 96 | df <- 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 | ) |
| 104 | ``` |
| Marc Kupietz | 21f526c | 2026-08-14 12:32:56 +0200 | [diff] [blame] | 105 | See [@kupietz_rkorapclient_2020] |
| 106 | See [@kupietz-deliko2026] |
| 107 | |
| Marc Kupietz | cf38344 | 2023-10-08 22:50:19 +0200 | [diff] [blame] | 108 | ## Source Code |
| 109 | ### Print Collocation Analysis as DataTable |
| 110 | |
| 111 | ```R |
| 112 | df %>% |
| Marc Kupietz | d8ddefb | 2026-05-04 19:41:45 +0200 | [diff] [blame] | 113 | mutate(Collocate=sprintf('<a href="%s">%s</a>', webUIRequestUrl, collocate)) %>% |
| Marc Kupietz | cf38344 | 2023-10-08 22:50:19 +0200 | [diff] [blame] | 114 | mutate(example=str_replace(example, |
| 115 | ".*(\\W+\\w+\\W+\\w+\\W+<mark.*/mark>.*)", "\\1")) %>% |
| 116 | mutate(example=str_replace(example, |
| 117 | "(.*<mark.*/mark>\\W+\\w+\\W+\\w+).*", "\\1")) %>% |
| 118 | rowwise() %>% |
| 119 | select(Collocate, Example, logDice, pmi, ll) %>% |
| 120 | datatable(escape = F) %>% |
| 121 | formatRound(columns=~logDice + pmi + ll, digits=2) |
| 122 | ``` |
| Marc Kupietz | 3b21719 | 2023-10-08 20:56:36 +0200 | [diff] [blame] | 123 | # References |
| 124 | |
| Marc Kupietz | 5115251 | 2023-10-09 23:18:10 +0200 | [diff] [blame] | 125 | ## References |
| 126 | |