dist_gc: Calculate pairwise great circle distance between points

Description Usage Arguments Examples

View source: R/misc.R

Description

Analogue of the dist() function, but calculating great circle distances. Points should be input as a two-column matrix or dataframe with longitude in the first column and latitude in the second.

Usage

1

Arguments

x

a two-column matrix or dataframe with longitude in the first column and latitude in the second

Examples

1
2
3
4
5
6
london_lon <- runif(20, min = -0.2, max = 0)
london_lat <- runif(20, min = 51.47, max = 51.53)
some_data  <- data.frame(longitude = london_lon, latitude = london_lat)
head(some_data)
distance_matrix <- dist_gc(some_data)
head(distance_matrix)

Michael-Stevens-27/silverblaze documentation built on May 28, 2021, 5:47 p.m.