Raises an error if the pairs can't be indexed, and a warning if comparing them may use a lot of memory (each pair takes about 64 bytes at the peak).
check_stop_pair_count(n_pairs, max_dist, arg_name, action, call)Invisibly returns NULL, if it doesn't raise an error.
A number, the pairs of stops to be compared.
A number, the distance given by the user, in meters.
The name of the user-facing distance argument.
A string that starts the warning, e.g. "Merging stops".
The environment of the user-facing function, so that the error mentions it.