An alternative interface to the main geodist function that directly
accepts inputs as individual vectors of coordinates, rather than the matrix
or `data.frame` inputs of the main function. This interface is provided for
cases where computational efficiency is important, and will generally provide
faster results than the main function.

geodist_vec(
x1,
y1,
x2,
y2,
paired = FALSE,
sequential = FALSE,
pad = FALSE,
measure = "cheap"
)

## Arguments

x1 |
Numeric vector of longitude coordinates |

y1 |
Numeric vector of latitude coordinates |

x2 |
Optional second numeric vector of longitude coordinates |

y2 |
Optional second numeric vector of latitude coordinates |

paired |
If `TRUE` , calculate paired distances between each entry
in `(x1, y1)` and `(x2, y2)` , returning a single vector. |

sequential |
If `TRUE` , calculate (vector of) distances
sequentially along `(x1, y1)` (when no `(x2, y2)` are passed),
otherwise calculate matrix of pairwise distances between all points. |

pad |
If `sequential = TRUE` values are padded with initial
`NA` to return `n` values for inputs of length `n` , otherwise
return `n - 1` values. |

measure |
One of "haversine" "vincenty", "geodesic", or "cheap"
specifying desired method of geodesic distance calculation; see Notes. |

## Value

If only `(x1, y1)`

are passed and `sequential = FALSE`

, a
square symmetric matrix containing distances between all items in ```
(x1,
y1)
```

; If only `(x1, y1)`

are passed and `sequential = TRUE`

, a
vector of sequential distances between matching elements of `(x1, y1)`

;
otherwise if `(x2, y2)`

are passed, a matrix of ```
lenght(x1) ==
length(y1)
```

rows and `length(x2) == length(y2)`

columns.

## Note

`measure = "cheap"`

denotes the mapbox cheap ruler
https://github.com/mapbox/cheap-ruler-cpp; `measure = "geodesic"`

denotes the very accurate geodesic methods given in Karney (2013)
"Algorithms for geodesics" J Geod 87:43-55, and as provided by the
codesf::st_dist() function.

## Examples

#> Maximum distance is > 100km. The 'cheap' measure is inaccurate over such
#> large distances, you'd likely be better using a different 'measure'.