click on the image to enlarge it
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") | |