pos1 <- list(lat = c(65, 66), lon = c(-19, -20))
pos2 <- list(lat = c(64, 65), lon = c(-19, -20))
dists <- arcdist(pos1, pos2) # pos1 and pos2 are lists of coordinates.
lat <- c(65, 66)
lon <- c(-19, -20)
lat1 <- c(64, 65)
lon1 <- c(-19, -20)
dists <- arcdist(lat, lon, lat1, lon1) # Input in vector format.
Run the code above in your browser using DataLab