Skip to contents

Create a Threshold Distance Graph

Usage

create.threshold.distance.graph(dist.matrix, threshold, include.names = TRUE)

Arguments

dist.matrix

Symmetric distance matrix.

threshold

Numeric distance threshold. Vertices with distance less than this value are connected.

include.names

Logical; if TRUE, preserve row names on adjacency and weight lists.

Value

A dgraph object. Use graph.adjacency(), graph.lengths(), graph.edges() and graph.stages() to inspect its stored graph stages. Construction and diagnostic information is stored in metadata.

Examples

distances <- as.matrix(dist(matrix(c(0, 1, 3), ncol = 1)))
create.threshold.distance.graph(distances, threshold = 1.5)
#> Undirected graph: 3 vertices, 1 edges
#> Stored stages: final