-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal.R
52 lines (39 loc) · 1016 Bytes
/
global.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
library(rsconnect)
library(tidyverse)
library(lubridate)
library(ggrepel)
library(leaflet)
library(htmlwidgets)
library(highcharter)
library(shiny)
library(shinyjs)
##### Process string/numeric to date #####
stringToDate <- function(targetString) {
if (class(targetString) != "character") {
targetString <- toString(targetString)
}
newString = paste(
substring(targetString, 1, 4),
substring(targetString, 5, 6),
substring(targetString, 7, 8),
sep = "-"
)
as.Date(newString)
}
parseUnicodeChar <- function(char) {
as.character(
parse(
text = shQuote(
gsub("<U\\+([A-Z0-9]+)>", "\\\\u\\1", char)
)
)
)
}
# Process data from ORDA and save as processedData.csv
# source('processing.R')
# Use saved data to speed up the app -------------------
originData <- read_csv("data/processedData.csv")
### data for options ###
partyOptions <- pull(distinct(originData, party))
genderOptions <- pull(distinct(originData, gender))
#library(profvis)