Last active
February 27, 2016 04:38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## source: https://github.com/toddwschneider/nyc-taxi-data/blob/master/analysis/analysis.R | |
dropoffs = query("SELECT * FROM dropoff_by_lat_long_cab_type ORDER BY count") | |
dropoffs = mutate(dropoffs, cab_type_id = factor(cab_type_id)) | |
p = ggplot() + | |
geom_polygon(data = ex_staten_island_map, | |
aes(x = long, y = lat, group = group), | |
fill = "#080808", color = "#080808") + | |
geom_point(data = dropoffs, | |
aes(x = dropoff_long, y = dropoff_lat, alpha = count, size = count, color = cab_type_id)) + | |
scale_alpha_continuous(range = alpha_range, trans = "log", limits = range(dropoffs$count)) + | |
scale_size_continuous(range = size_range, trans = "log", limits = range(dropoffs$count)) + | |
scale_color_manual(values = c("#ffffff", green_hex)) + | |
coord_map(xlim = range(ex_staten_island_map$long), ylim = range(ex_staten_island_map$lat)) + | |
title_with_subtitle("New York City Taxi Drop Offs", "2009–2015") + | |
theme_dark_map(base_size = 24) + | |
theme(legend.position = "none") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment