I am making a map about exports from the Americas to the Netherlands. To visualise my data, I want to make a map with arrows from countries in the Americas to the Netherlands. I use a cshapes world map and ggplot2.
data = data.frame("Country.name" = c("Brazil","USA","Canada","Paraguay","Uruguay"), "lng" =
c(14.23,37,56.13,-23.44,-32.52), "lat" = c(-51.92,-95.71,-106.34,-58.44,-55.77))
require(cshapes)
cshp.data = cshp(date=as.Date("2012-1-1"), useGW=TRUE)
region.data.frame = fortify(cshp.data, region = "ISO1AL3")
ggplot(region.data.frame) + geom_polygon(aes(long,lat,group=group)) +
geom_segment(data = data, aes(x = lat, y = lng, xend= (5.29 - 0.1 * (5.29 - lat)), yend= (52.13 - 0.1 * (52.13 - lng))),
arrow=arrow(length=unit(0.5,"cm"), angle = 45, type = "closed"))
I have found that the lines overlap when they are plotted straight. This is ugly. Therefore, I am looking for a way to plot curved lines between coordinates within ggplot2, so they don't overlap.