I found this great tutorial on how to use maps and geosphere to connect points on a map in R using great circles:
https://flowingdata.com/2011/05/11/how-to-map-connections-with-great-circles/
Is there a way to make the lines go the other way if they run off the edge of the map (cross the international dateline):
My current code looks like this for a line connecting DC to Beijing:
library(maps)
library(geosphere)
map("world")
lat_ca <- 38.89511
lon_ca <- -77.03637
lat_me <- 39.917
lon_me <- 116.383
inter <- gcIntermediate(c(lon_ca, lat_ca), c(lon_me, lat_me), n=50, addStartEnd=TRUE)# breakAtDateLine=TRUE)
lines(inter)
to be clear, I would like to end up with something that looks like this:
It seems like this would be the other arc of a great circle in the same plane as the first one but I can't figure out how to draw it.