#Example used in the Urbam Computing course
#Thiago H Silva - www.dainf.ct.utfpr.edu.br/~thiagoh

library("ggmap")
library("ggplot2")
checkins <- read.delim("BHcheckins.txt", header=FALSE, sep="\t")

names(checkins) <- c("LAT","LON")

map.in <- get_map(location ="Belo Horizonte", zoom=12,source = "osm")

ggmap(map.in)+
geom_bin2d(data=checkins, aes(x = LON, y = LAT), binwidth = 0.005,alpha = 0.4) + 

scale_fill_gradient(low = "yellow", high = "red") 

