Skip to contents

Cluster Nodes Based on Link Connectivity

Usage

link2cluster(link, nodes)

Arguments

link

A data frame with two columns (i, j) indicating node pairs with links.

nodes

A character or factor vector of all node names to be clustered.

Value

A numeric vector of cluster labels for each node, as assigned by DBSCAN.

Details

Given a set of links between node pairs and a list of all nodes, this function constructs a symmetric adjacency matrix, applies diffusion to expand connectivity, and clusters the result using DBSCAN.

Examples

link_df <- data.frame(i = c("A", "B", "C"), j = c("B", "C", "A"))
clusters <- link2cluster(link_df, nodes = c("A", "B", "C"))
#> Error in link2cluster(link_df, nodes = c("A", "B", "C")): could not find function "link2cluster"
print(clusters)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'print': object 'clusters' not found