Skip to content

Commit 3df159b

Browse files
committed
Make shiny frequency curves run as a proper R demo
Change-Id: I75dbfd97c98cd586f012e4d6409ed71d7745a201
1 parent 5fb892e commit 3df159b

File tree

10 files changed

+13
-231
lines changed

10 files changed

+13
-231
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
^docs$
99
^_pkgdown\.yml$
1010
^CRAN-RELEASE$
11+
^.*\.log$

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
.Ruserdata
55
cache/
66
docs
7+
*.log

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Changes
44
- collocationScoreQuery method added
55
- hc_add_onclick_korap_search function added
6+
- shiny web application demo added
67
- support for orphaned plotly package dropped
78

89
# RKorAPClient 0.5.9

demo/00Index

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ alternativesOverTime Plot proportion of alternative spellings/variants over
55
regional Map plot regional frequencies of query expression
66
mosaicplot Visualize frequencies of alternative query terms in relation to other variables
77
highcharter-example Visualize frqequencies of optionally alternative terms over time with interactive HTML and JavaScript elements using the package highcharter as wrapper for Highcharts
8+
shiny-frequency-curves Web application that plots frequency curves with highcharts and shiny
89
writtenVsSpoken Compare frequencies in written vs. spoken corpora

demo/shiny-apps/frequency_curves/theme-ids-dark.R

Lines changed: 0 additions & 228 deletions
This file was deleted.

demo/shiny-frequency-curves.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shiny::runApp(system.file("shiny-apps", "frequency_curves", package="RKorAPClient"))

demo/shiny-apps/frequency_curves/server.R renamed to inst/shiny-apps/frequency_curves/server.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
hc_theme <- if(require(idsThemeR)) {
2+
idsThemeR::hc_theme_ids_light()
3+
} else {
4+
hc_theme_hcrt()
5+
}
16
rsr <- new("KorAPConnection", verbose = TRUE)
27
vc <- "(textType = /Zeit.*/ | textTypeRef=Plenarprotokoll) & availability!=QAO-NC-LOC:ids & creationDate in"
38
years <- c(2005:2020)
@@ -36,7 +41,7 @@ plotHighchart <- function(query = c("Tolpatsch", "Tollpatsch"),
3641
as.alternatives = as.alternatives) %>%
3742
hc_freq_by_year_ci(as.alternatives, smooth = T) %>%
3843
hc_yAxis(title = list(text = "Instanzen pro Million Wörter")) %>%
39-
hc_add_theme(hc_theme_ids_light()) %>%
44+
hc_add_theme(hc_theme) %>%
4045
hc_caption(text = paste(
4146
"Frequenzverläufe (mit 95%-Konfidenzbändern) im",
4247
"<a href='http://www.dereko.de'>Deutschen Referenzkorpus DeReKo</a>",

demo/shiny-apps/frequency_curves/ui.R renamed to inst/shiny-apps/frequency_curves/ui.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ library(highcharter)
33
library(RKorAPClient)
44
library(utils)
55
library(stringr)
6-
library(idsThemeR)
7-
#source("theme-ids-dark.R")
6+
library()
87
options(shiny.autoreload = TRUE)
98

9+
1010
shinyUI(
1111
fluidPage(
1212
title = "Wortfrequenzverläufe in DeReKo",

0 commit comments

Comments
 (0)