I am using greatCircle {geosphere} function to create a map. I am able to run the code and get the desired connecting lines across the locations. But additionally I am getting an arbitrary straight line in the middle of the map. I am not able to understand why it's happening. And how it can be dropped? I am pasting the picture and the below.
library("maps")
library("geosphere")
getGreatCircle <- function(userLL,relationLL){
tmpCircle = greatCircle(userLL,relationLL, n=200)
start = which.min(abs(tmpCircle[,1] - data.frame(userLL)[1,1]))
end = which.min(abs(tmpCircle[,1] - relationLL[1]))
greatC = tmpCircle[start:end,]
return(greatC)}
par(mar=c(0,0,0,0))
# World map
map('world',
col="#f2f2f2", fill=TRUE, bg="white", lwd=0.05,
mar=rep(0,4),border=0, ylim=c(-80,80))
for(i in 1:60){for(j in 1:60){ if(i != j){inter<- getGreatCircle(c(world.cities$long[i],world.cities$lat[i]),c(world.cities$long[j],world.cities$lat[j]))
lines(inter, col="skyblue", lwd=0.2)}}
}