Learn R Programming

Directional (version 6.8)

Haversine distance matrix: Harvesine distance matrix

Description

Haversine distance matrix.

Usage

haversine.dist(x)

Value

A matrix with the haversine distances between all observations.

Arguments

x

A a matrix of two columns. The first column is the latitude and the second the longitude.

Author

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

Details

The function computes the haversine distance between all observations.

References

https://en.wikipedia.org/wiki/Haversine_formula

See Also

cosnn, dirknn

Examples

Run this code
x <- rvmf(10, rnorm(3), 10)
x <- euclid.inv(x)
haversine.dist(x)

Run the code above in your browser using DataLab