dist.connections: Get a List of Node Pairs which are No Farther Away from Each...

Description Usage Arguments Value Examples

Description

A maximum distance max.distance is specified as well as a distance object dist. We return a list of binary vectors, where each vector identifies a connection between two nodes no longer than the specified maximum distance.

Usage

1
dist.connections(dist, max.distance = 1)

Arguments

dist

the distance object

max.distance

the maximum distance for two nodes to be considered as connected

Value

the list of all node-node connections

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# create distance matrix with Euclidean distance between points in 1D plane
dm <- dist.create(dist.apply(X=c(1, 2, 4, 3, 10, 11)))
con <- dist.connections(dm, 1)
# [[1]]
# [1] 1 2 # -> points with coordinates "1" and "2" are connected
#
# [[2]]
# [1] 2 4 # -> points with coordinates "2" and "3" are connected
#
# [[3]]
# [1] 3 4 # -> points with coordinates "4" and "3" are connected
#
# [[4]]
# [1] 5 6 # -> points with coordinates "10" and "11" are connected

thomasWeise/distanceR documentation built on May 14, 2019, 7:35 a.m.