-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal.R
48 lines (32 loc) · 1.15 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
library(shiny)
library(shinythemes)
library(leaflet)
library(dplyr)
library(DT)
library(maps)
library(sp)
library(maps)
library(rgdal)
library(maptools)
library(RColorBrewer)
library(tmap)
load("df_map_hc.Rda")
load("df_map_trump.Rda")
load("tweet_trump.Rda")
load("tweet_hc.Rda")
#Icons using the github leaflet package
icon.red <- makeAwesomeIcon(icon = 'fa-twitter', markerColor = 'red', library='fa',
iconColor = 'black')
icon.green <- makeAwesomeIcon(icon = 'fa-twitter', markerColor = 'green', library='fa',
iconColor = 'black')
#shapefile
usgeo <- read_shape("tl_2014_us_state.shp")
usgeo$NAME <- tolower(usgeo$NAME)
usgeomain <- usgeo[usgeo@data$NAME!="alaska"
&usgeo@data$NAME!="hawaii"
&usgeo@data$NAME!="united states virgin islands"
&usgeo@data$NAME!="commonwealth of the northern mariana islands"
&usgeo@data$NAME!="guam"
&usgeo@data$NAME!="american samoa"
&usgeo@data$NAME!="puerto rico"
,]