Learn R Programming

gtfstools (version 2.0.1)

cluster_stop_nodes: Cluster stop nodes by distance

Description

Finds the pairs of nodes within max_dist of each other with find_stop_pairs_within() and merges them with cpp_merge_stop_clusters().

Usage

cluster_stop_nodes(lat, lon, max_dist)

Value

An integer vector with the cluster of each node. When every pair of nodes is surely within max_dist, all nodes are in cluster 1 and the pairs are not calculated.

Arguments

lat, lon

Numeric vectors with the coordinates of each node, in degrees.

max_dist

A number, in meters.