Last active
August 14, 2016 21:48
-
-
Save rafapereirabr/eff077bc30e6e23b889bef62d709530a to your computer and use it in GitHub Desktop.
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
library(data.table) | |
library(ggmap) | |
# load data. Obs: The file used in this example does not allow to create flow maps | |
df <- fread("your_data.csv) | |
# Get Map background | |
map <- get_map(location = c(lon = -43.45967, lat = -22.92728), | |
zoom = 10, source = "stamen", maptype = "toner-background") | |
# plot | |
ggmap(map) + | |
geom_path(data = df, aes(x= longitude, y= latitude, color= route_id ), alpha=0.3) + | |
coord_map(xlim = c(-43.828854, -43.117908),ylim = c(-23.091709, -22.760493)) + | |
theme(legend.position="none") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment