-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHBG_Food_Map.R
35 lines (26 loc) · 917 Bytes
/
HBG_Food_Map.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
#rmaps
# install relevant packages
install.packages("devtools")
library(devtools)
install_github('arilamstein/[email protected]')
library(choroplethrZip)
install.packages("ggplot")
library(ggplot2)
install.packages("RCurl")
library(RCurl)
#open food data
food.raw<-getURL("https://raw.githubusercontent.com/bac3917/Harrisburg-Food/master/HarrisburgFood.csv")
HBGfood<-read.csv(text=food.raw)
head(HBGfood)
#zip zoom
data(df_pop_zip)
hbgZIPS = c("17101", "17102", "17103", "17104", "17110", "17111", "17120")
Harrisburg<-zip_choropleth(df_pop_zip,
zip_zoom=c(hbgZIPS),
title="2012 Harrisburg ZCTA Population Estimates",
legend="Population",
num_colors=1,
reference_map = TRUE)
Harrisburg
FoodMap<-Harrisburg+ geom_point(data=HBGfood, aes(x=HBGfood$Lon, y=HBGfood$Lat), color='red' )
FoodMap