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