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