Description Usage Arguments Value Examples
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.
1 | dist.connections(dist, max.distance = 1)
|
dist |
the distance object |
max.distance |
the maximum distance for two nodes to be considered as connected |
the list of all node-node connections
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.