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