Title: ggplot, ggmap, overlay street and choropleth maps with point geometry
Tags: r;ggplot2;ggmap;choroplethr
Question: I can overlay a street map with points, and a choropleth map with points, but can't combine all three. I suspect that I can't print two ggmap objects over each other at the same time. Any ideas as to how to do this? My goal is to have a bottom layer consisting of the streets (and optionally names), a middle layer of population densities, and a top layer of points.
Thanks. Code below.
#load libraries
library(choroplethr)
library(choroplethrZip)
library(ggplot2)
library(ggmap)
#data csgb consists of lat col, long col, and key col
LATITUDE LONGITUDE BRANCH_KEY
1  32.47220 -85.00600       4734
2  32.53800 -84.86872       2594
3  32.46230 -84.92930       2604
4  32.47980 -84.94440       2584
5  32.36980 -84.96440       4727
6  32.49530 -85.02460       2948
7  32.37880 -84.90680       2601
8  32.52820 -84.99200       2632
9  32.49200 -85.01850       2947
10 32.52820 -84.99200       2595
11 32.53950 -84.96621       2589
12 32.42834 -84.94377       2583
13 32.46171 -84.97530       2578
14 32.54730 -84.93620       2603
15 32.52391 -84.92921       2598
16 32.79890 -84.57980       2588
17 32.46736 -84.99550       2907
18 32.47630 -84.99170       2602
19 32.47850 -84.97950       2590
20 32.46480 -84.98760       2580
21 32.52365 -84.92954       2586
#choropleth map is a ggplot object (and it renders on a device)
map <- zip_choropleth(df_pop_zip, title = 'Columbus - Phenix Cty Zip Codes',     legend = 'Population Key',
num_colors = 9,
msa_zoom = 'Columbus, GA-AL')
class(map)
[1] "gg"     "ggplot"
#get a bounding box for a street map
leftbbx = min(map$data$long)
bottombbx = min(map$data$lat)
rightbbx = max(map$data$long)
topbbx = max(map$data$lat)v
# street map is a ggplot object, and it displays on a device
m1 <- get_map(location = c(leftbbx, bottombbx, rightbbx, topbbx), source = 'google', maptype = 'roadmap')
m1 <- ggmap(m1)
class(m1)
[1] "gg"     "ggplot"
#get points
mapoints <- geom_point(aes(x = LONGITUDE, y = LATITUDE, group = BRANCH_KEY), data = csgb, color = 'red')
# this works! ;-)
map + mapoints
# this also works! ;-)
m1 + mapoints
# this fails? :-(
map + m1
Error in p + o : non-numeric argument to binary operator
In addition: Warning message:
Incompatible methods ("+.gg", "Ops.data.frame") for "+"
m1 + map
Error in p + o : non-numeric argument to binary operator
In addition: Warning message:
Incompatible methods ("+.gg", "Ops.data.frame") for "+"
Comment: You might consider posting a comment on the answer to [this question](http://stackoverflow.com/questions/30787877/making-a-zip-code-choropleth-in-r-using-ggplot2-and-ggmap), as this appears to be the author of the package.

Comment: Where does `df_pop_zip` come from??

Comment: df_pop_zip is a data file from choroplethr.    head(df_pop_zip)
region value
132  01001 17380
133  01002 28718
134  01003 11286
135  01005  5120
136  01007 14593
137  01008  1160



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 3, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2015:00:09/14/15', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<r><ggplot2><ggmap><choroplethr>', 'Title': 'ggplot, ggmap, overlay street and choropleth maps with point geometry', 'ViewCount': 709, 'id': 32568603, 'user_AboutMe': '<p>Currently Microsoft Software and Systems Academy instructor in the Cloud Application Development track. Before that, quantitative analyst, database manager, technical college instructor (web development and programming), and systems administrator. Major interests include programming languages, databases of various types, data analysis and analytics, and back-end web development.</p>\n', 'user_AccountId': 1602502.0, 'user_DisplayName': 'ccc31807', 'user_Reputation': 751.0, 'user_Views': 175.0, 'user_id': 1483288.0}}