This is my first time on here and I am really stumped on this one.
So I have a file of bay area housing prices (here called SAMPLE3.csv) and shapefiles of Bay Area zip codes. I am able to match the two and use fortify to melt the zip codes, as well as able to plot the data on the map, but cannot adjust the color scheme correctly to make a heat map (using, for instance, heat.colors). Here is my code:
houseprices <- read.csv("~/DigitalFlyer/GIS/bayarea/SAMPLE3.csv", header=T)
bayarea <- USA[USA$city == 'bayarea',]
sf = fortify(bayarea, region="ZCTA5CE10")
sf$score <- engagement[match(sf$id, houseprices$zip, nomatch=NA), 2]
I can get a nice google map as a base layer using
qmap('oakland, ca', zoom=10,maptype='hybrid')+
geom_polygon(aes(x=long, y=lat, group=group), data=sf, colour="white", fill=sf$score, alpha=.5, size=.3)
I can get a nice heat map with qmap using
qplot(long, lat, data=sd, group=group , fill= score, geom="polygon"),
but then cannot layer that on the google map.
Here is what I get with each: 1) https://i.stack.imgur.com/vJOHe.jpg 2) https://i.stack.imgur.com/bCeG4.jpg
Thank you for your help in advance!!!