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: |
| 10 | revealjs::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 |
| 24 | 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] | 25 | --- |
| 26 | |
| 27 | ```{r setup, include=FALSE} |
Marc Kupietz | 3b21719 | 2023-10-08 20:56:36 +0200 | [diff] [blame] | 28 | knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE) |
Marc Kupietz | 2c09462 | 2023-10-08 14:19:47 +0200 | [diff] [blame] | 29 | library(idsThemeR) |
Marc Kupietz | 289f997 | 2023-10-09 09:49:12 +0200 | [diff] [blame] | 30 | library(RKorAPClient) |
Marc Kupietz | 2c09462 | 2023-10-08 14:19:47 +0200 | [diff] [blame] | 31 | library(highcharter) |
| 32 | library(tidyverse) |
Marc Kupietz | 8a15259 | 2023-10-09 12:32:16 +0200 | [diff] [blame] | 33 | 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] | 34 | ``` |
Marc Kupietz | 5115251 | 2023-10-09 23:18:10 +0200 | [diff] [blame] | 35 | # Introduction |
Marc Kupietz | a737b1b | 2023-10-07 09:32:20 +0200 | [diff] [blame] | 36 | |
| 37 | ## R Markdown |
| 38 | |
Marc Kupietz | 3b21719 | 2023-10-08 20:56:36 +0200 | [diff] [blame] | 39 | 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] | 40 | |
| 41 | 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. |
| 42 | |
| 43 | ## Slide with Bullets |
| 44 | ### Subheading |
| 45 | |
| 46 | - Bullet 1 |
| 47 | - Bullet 2 |
| 48 | - Bullet 3 |
| 49 | |
| 50 | <aside class="notes"> |
| 51 | Here are some notes. |
| 52 | </aside> |
| 53 | |
Marc Kupietz | 5115251 | 2023-10-09 23:18:10 +0200 | [diff] [blame] | 54 | # Methods |
| 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 | 5115251 | 2023-10-09 23:18:10 +0200 | [diff] [blame] | 68 | # Results |
| 69 | |
Marc Kupietz | 2c09462 | 2023-10-08 14:19:47 +0200 | [diff] [blame] | 70 | ## Registered Users |
Marc Kupietz | 5115251 | 2023-10-09 23:18:10 +0200 | [diff] [blame] | 71 | ### for COSMAS II and KorAP |
Marc Kupietz | 2c09462 | 2023-10-08 14:19:47 +0200 | [diff] [blame] | 72 | |
| 73 | ```{r registrations, message=F, warning=F} |
| 74 | registrierungen <- |
| 75 | read_tsv("http://www.ids-mannheim.de/cosmas2/projekt/intstats/registrierungen.csv") %>% |
| 76 | add_column(group = "registered users") |
| 77 | |
| 78 | hc <- registrierungen %>% |
| 79 | hchart("line", hcaes(x=date, y=registered, group=group)) %>% |
| 80 | hc_add_theme(hc_theme_ids_light()) %>% |
| 81 | hc_yAxis(title=list(text="")) %>% |
| 82 | hc_xAxis(title=list(text="")) %>% |
| 83 | hc_legend(element_blank()) %>% |
Marc Kupietz | 62c7283 | 2024-05-14 22:08:15 +0200 | [diff] [blame] | 84 | hc_size(height=500, width=1260) |
Marc Kupietz | 2c09462 | 2023-10-08 14:19:47 +0200 | [diff] [blame] | 85 | hc |
| 86 | |
| 87 | ``` |
Marc Kupietz | cf38344 | 2023-10-08 22:50:19 +0200 | [diff] [blame] | 88 | |
| 89 | ## Light Verb Constructions |
Marc Kupietz | 5115251 | 2023-10-09 23:18:10 +0200 | [diff] [blame] | 90 | ### with *take* in ICC-English |
Marc Kupietz | cf38344 | 2023-10-08 22:50:19 +0200 | [diff] [blame] | 91 | |
Marc Kupietz | 5115251 | 2023-10-09 23:18:10 +0200 | [diff] [blame] | 92 | ```{r take-icc, fig.cap="Collocation analysis results for *take* + NOUN in [ICC-ENG](https://korap.ids-mannheim.de/instance/icc), using the RKorAPClient [@kupietz_rkorapclient_2020] package."} |
Marc Kupietz | cf38344 | 2023-10-08 22:50:19 +0200 | [diff] [blame] | 93 | take_ca_icc <- |
| 94 | collocationAnalysis( |
| 95 | icc_con("eng"), |
| 96 | "focus({[ud/l=take]} [ud/p=NOUN])", |
| 97 | leftContextSize = 0, |
| 98 | rightContextSize = 1, |
| 99 | minOccur = 2, |
| 100 | addExamples = T |
Marc Kupietz | 8a15259 | 2023-10-09 12:32:16 +0200 | [diff] [blame] | 101 | ) %>% head(7) |
Marc Kupietz | cf38344 | 2023-10-08 22:50:19 +0200 | [diff] [blame] | 102 | |
| 103 | take_ca_icc %>% show_table() |
| 104 | ``` |
| 105 | |
| 106 | ## Source Code |
| 107 | ### Collocation Analysis |
| 108 | |
| 109 | ```R |
| 110 | df <- collocationAnalysis( |
| 111 | icc_con("eng"), |
| 112 | "focus({[ud/l=take]} [ud/p=NOUN])", |
| 113 | leftContextSize = 0, |
| 114 | rightContextSize = 1, |
| 115 | minOccur = 2, |
| 116 | addExamples = T |
| 117 | ) |
| 118 | ``` |
| 119 | |
| 120 | ## Source Code |
| 121 | ### Print Collocation Analysis as DataTable |
| 122 | |
| 123 | ```R |
| 124 | df %>% |
| 125 | mutate(Collocate=sprintf('<a href="%s">%s</a>', |
| 126 | webUIRequestUrl, collocate)) %>% |
| 127 | mutate(example=str_replace(example, |
| 128 | ".*(\\W+\\w+\\W+\\w+\\W+<mark.*/mark>.*)", "\\1")) %>% |
| 129 | mutate(example=str_replace(example, |
| 130 | "(.*<mark.*/mark>\\W+\\w+\\W+\\w+).*", "\\1")) %>% |
| 131 | rowwise() %>% |
| 132 | select(Collocate, Example, logDice, pmi, ll) %>% |
| 133 | datatable(escape = F) %>% |
| 134 | formatRound(columns=~logDice + pmi + ll, digits=2) |
| 135 | ``` |
Marc Kupietz | 3b21719 | 2023-10-08 20:56:36 +0200 | [diff] [blame] | 136 | # References |
| 137 | |
Marc Kupietz | 5115251 | 2023-10-09 23:18:10 +0200 | [diff] [blame] | 138 | ## References |
| 139 | |