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 | 289f997 | 2023-10-09 09:49:12 +0200 | [diff] [blame^] | 36 | if (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 Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 41 | ``` |
| 42 | |
| 43 | ## R Markdown |
| 44 | |
Marc Kupietz | 3b21719 | 2023-10-08 20:56:36 +0200 | [diff] [blame] | 45 | 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] | 46 | |
| 47 | 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. |
| 48 | |
| 49 | ## Slide with Bullets |
| 50 | ### Subheading |
| 51 | |
| 52 | - Bullet 1 |
| 53 | - Bullet 2 |
| 54 | - Bullet 3 |
| 55 | |
| 56 | <aside class="notes"> |
| 57 | Here are some notes. |
| 58 | </aside> |
| 59 | |
Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 60 | ## Slide with R Output |
| 61 | |
| 62 | ```{r cars, echo = TRUE} |
| 63 | summary(cars) |
| 64 | ``` |
| 65 | |
| 66 | ## Slide with Plot |
| 67 | |
| 68 | ```{r pressure} |
| 69 | plot(pressure) |
| 70 | ``` |
| 71 | |
Marc Kupietz | 2c09462 | 2023-10-08 14:19:47 +0200 | [diff] [blame] | 72 | ## Registered Users |
| 73 | ### (for COSMAS II and KorAP) |
| 74 | |
| 75 | ```{r registrations, message=F, warning=F} |
| 76 | registrierungen <- |
| 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 Kupietz | cf38344 | 2023-10-08 22:50:19 +0200 | [diff] [blame] | 90 | |
| 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."} |
| 95 | take_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 | |
| 105 | take_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 |
| 126 | df %>% |
| 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 Kupietz | 3b21719 | 2023-10-08 20:56:36 +0200 | [diff] [blame] | 139 | # References |
| 140 | |