Skip to content

Instantly share code, notes, and snippets.

@WalkerHarrison
Created April 24, 2017 07:08
Show Gist options
  • Save WalkerHarrison/4f54de844b8ef630011aebe2bfb83f9b to your computer and use it in GitHub Desktop.
Save WalkerHarrison/4f54de844b8ef630011aebe2bfb83f9b to your computer and use it in GitHub Desktop.
zoom <- subset(trees, zipcode %in% c(11239, 11206, 11212, 11224, 11221,
11201, 11215, 11217, 11231, 11234))
zoom$hood <- as.factor(ifelse(zoom$zipcode %in% c(11201, 11215, 11217, 11231, 11234), 1,0))
map <- get_map(location = c(lon = -73.95, lat = 40.64), zoom = 12,
maptype = "satellite", source = "google")
ggmap(map) + geom_point(data=zoom, aes(x = longitude, y = latitude, col = hood),
size = 0.5, shape = 16, alpha = 0.1, show.legend = F)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment