-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.R
72 lines (62 loc) · 2.66 KB
/
common.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
library(tidyverse)
library(wordbankr)
library(shiny)
library(shinyBS)
library(waiter) # for waiting bar
# library(spsComps) # for shinyCatch
select <- dplyr::select
font <- "Source Sans Pro"
theme_set(theme_bw(base_size = 16, base_family = font))
theme_update(panel.grid = ggplot2::element_blank(),
strip.background = ggplot2::element_blank(),
legend.key = ggplot2::element_blank(),
panel.border = ggplot2::element_blank(),
axis.line = ggplot2::element_line(),
strip.text = ggplot2::element_text(face = "bold"))
shiny_theme <- shinythemes::shinytheme("cosmo")
enableBookmarking()
bookmark <- bookmarkButton("Save settings", class = "btn-default btn-xs")
# slightly hacky way to determine if you're on the shiny server
# use localhost if on shiny server
my_host <- system("hostname", intern = TRUE)
db_host <- if (my_host == "ip-172-31-32-12") "localhost" else get_wordbank_args()$host
shiny_db_args <- list(
host = db_host,
dbname = "wordbank",
user = "wordbank_reader",
password = "ICanOnlyRead@99"
)
# constants
possible_demo_fields <- list("None" = "identity",
"Birth Order" = "birth_order",
"Caregiver's Education" = "caregiver_education",
"Sex" = "sex",
"Ethnicity" = "ethnicity",
"Race" = "race")
pt_color <- "#839496"
start_language <- "English (American)"
start_form <- "WS"
start_measure <- "produces"
start_demo <- "identity"
Sys.setlocale(locale = "en_US.UTF-8")
# form substitutions:
form_names <- list("Words and Gestures" = "WG",
"Words and Sentences" = "WS",
"Infant Checklist" = "IC",
"Toddler Checklist" = "TC",
"Twins Early Development (TEDS) Short Form - 2 years" = "TEDS Twos",
"Twins Early Development (TEDS) Short Form - 3 years" = "TEDS Threes",
"Form Variant A" = "FormA",
"Form Variant B1" = "FormBOne",
"Form Variant B2" = "FormBTwo",
"Form Variant C" = "FormC",
"Oxford CDI" = "Oxford CDI",
"Swingley Form" = "Swingley",
"Form Variant 1" = "FormOne",
"Form Variant 2A" = "FormTwoA" ,
"Form Variant 2B" = "FormTwoB",
"Form Variant 3" = "FormThree",
"CDI Two" = "CDITwo",
"Words and Sentences (Short Form)" = "WSShort",
"Words and Gestures (Short Form)" = "WGShort",
"Oxford Short Form" = "OxfordShort")