forked from OHI-Science/global-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal.R
64 lines (48 loc) · 1.4 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
## global variables
## sources goal data for map and chart modules
## defines global variables, source code, etc
## SET UP ENVIRONMENT ##
## libraries
library(sf)
library(tidyverse)
library(shinydashboard)
library(RColorBrewer)
library(plotly)
library(sunburstR)
library(viridis)
library(stringr)
library(USAboundaries)
library(DescTools)
library(janitor)
library(sendmailR)
library(shinyAce)
library(DT)
library(cowplot)
library(shinyWidgets)
## Color Palettes
# Eliminate super light yellow colors
# Good for both colorQuantile() and colorNumeric()
ygb <- colorRampPalette(brewer.pal(5,'YlGnBu'))(200) # Yellow, Green, Blue
ygb_cols <- ygb[19:200]
OrRd <- colorRampPalette(brewer.pal(5, 'OrRd'))(200) # Orange, Red
OrRd_cols <- OrRd[19:200]
## SOURCE EXTERNAL SCRIPTS ##
## source modules
source("modules/chart_card.R")
source("modules/choro_map_card.R")
source("modules/minichart_map_card.R")
source("modules/dot_map_card.R")
source("modules/summary_stats_card.R")
## source functions
source("functions/helper_functions.R")
source("functions/ui_functions.R")
## source front page css/html customization
source("front_page.R")
## set: no scientific notation and round to 2 decimals
options(scipen = 999,
digits = 5)
## US AQUACULTURE DATA SOURCES ##
source("dataprep/us-fish.R")
source("dataprep/us-shell.R") # combines us-fish and us-shell
## SHRIMP IMPORT REFUSALS ##
source("dataprep/us-import-refusals.R")