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 | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 4 | author: Marc Kupietz |
| 5 | institute: "IDS Mannheim" |
Marc Kupietz | 2c09462 | 2023-10-08 14:19:47 +0200 | [diff] [blame] | 6 | date: "Mannheim, 2023-10-08" |
Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 7 | output: |
| 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 Kupietz | 7c8f7de | 2023-10-07 11:42:29 +0200 | [diff] [blame] | 19 | slideNumber: true |
Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 20 | chalkboard: |
| 21 | theme: chalkboard |
| 22 | toggleNotesButton: true |
| 23 | menu: |
| 24 | numbers: true |
Marc Kupietz | 3b21719 | 2023-10-08 20:56:36 +0200 | [diff] [blame] | 25 | lang: en |
| 26 | bibliography: references.bib |
| 27 | csl: "https://raw.githubusercontent.com/ICLC-10/Zotero/master/styles/ICLC-10.csl" |
Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 28 | --- |
| 29 | |
| 30 | ```{r setup, include=FALSE} |
Marc Kupietz | 3b21719 | 2023-10-08 20:56:36 +0200 | [diff] [blame] | 31 | knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE) |
Marc Kupietz | 2c09462 | 2023-10-08 14:19:47 +0200 | [diff] [blame] | 32 | library(idsThemeR) |
Marc Kupietz | 289f997 | 2023-10-09 09:49:12 +0200 | [diff] [blame] | 33 | library(RKorAPClient) |
Marc Kupietz | 2c09462 | 2023-10-08 14:19:47 +0200 | [diff] [blame] | 34 | library(highcharter) |
| 35 | library(tidyverse) |
Marc Kupietz | 8a15259 | 2023-10-09 12:32:16 +0200 | [diff] [blame^] | 36 | 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] | 37 | ``` |
| 38 | |
| 39 | ## R Markdown |
| 40 | |
Marc Kupietz | 3b21719 | 2023-10-08 20:56:36 +0200 | [diff] [blame] | 41 | 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] | 42 | |
| 43 | 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. |
| 44 | |
| 45 | ## Slide with Bullets |
| 46 | ### Subheading |
| 47 | |
| 48 | - Bullet 1 |
| 49 | - Bullet 2 |
| 50 | - Bullet 3 |
| 51 | |
| 52 | <aside class="notes"> |
| 53 | Here are some notes. |
| 54 | </aside> |
| 55 | |
Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 56 | ## Slide with R Output |
| 57 | |
| 58 | ```{r cars, echo = TRUE} |
| 59 | summary(cars) |
| 60 | ``` |
| 61 | |
| 62 | ## Slide with Plot |
| 63 | |
| 64 | ```{r pressure} |
| 65 | plot(pressure) |
| 66 | ``` |
| 67 | |
Marc Kupietz | 2c09462 | 2023-10-08 14:19:47 +0200 | [diff] [blame] | 68 | ## Registered Users |
| 69 | ### (for COSMAS II and KorAP) |
| 70 | |
| 71 | ```{r registrations, message=F, warning=F} |
| 72 | registrierungen <- |
| 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 Kupietz | cf38344 | 2023-10-08 22:50:19 +0200 | [diff] [blame] | 86 | |
| 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."} |
| 91 | take_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 Kupietz | 8a15259 | 2023-10-09 12:32:16 +0200 | [diff] [blame^] | 99 | ) %>% head(7) |
Marc Kupietz | cf38344 | 2023-10-08 22:50:19 +0200 | [diff] [blame] | 100 | |
| 101 | take_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 |
| 122 | df %>% |
| 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 Kupietz | 3b21719 | 2023-10-08 20:56:36 +0200 | [diff] [blame] | 135 | # References |
| 136 | |