View source: R/accessory_geo.R
minDist | R Documentation |
The function calculates the minimum distance between coordinates or the coordinates which are below a minimum threshold distance.
minDist(lon, lat, min.dist = 0.001, output = NULL)
lon |
numerical. Longitude in decimal degrees |
lat |
numerical. Latitude in decimal degrees |
min.dist |
numerical. Minimum threshold distance (in kilometers) to be used to detect duplicated coordinates. Default to 1 meter. |
output |
character. The type of information that should be returned (see Details) |
The argument output
controls the type of output that should be
returned:
'flag': a TRUE/FALSE vector indicating the coordinates which are below
min.dist
from other coordinates.
'group': the position of the first coordinate representing a group of duplicated coordinates.
'dist': the distance of each coordinate to the closest coordinated.
A vector of TRUE/FALSE or of minimum distances in kilometers.
Renato A. F. de Lima
geoDist
lat <- c(-23.475389, -23.475389, -23.475390, -23.475389) lon <- c(-47.123768, -47.123768, -47.123768, -47.123868) ## Not run: minDist(lon, lat, output = 'group') minDist(lon, lat, output = 'flag') minDist(lon, lat, output = 'dist') ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.