hca_flowdat: Use hierarchical clustering to merge nodes based on proximity

View source: R/hca_flowdat.R

hca_flowdatR Documentation

Use hierarchical clustering to merge nodes based on proximity

Description

Use hierarchical clustering to merge nodes based on proximity

Usage

hca_flowdat(flowdat, k = 20, return_cluster_assignment = FALSE)

Arguments

flowdat

The data containing flows from a to b, b to a, and the coordinates of a and b

k

The number of nodes to keep.

return_cluster_assignment

Instead of an updated flowdat, return a dataframe with the cluster assignment of each node.

Value

a dataframe of the same format as flowdat, but with some nodes (and their flows) merged. Note that this will in most cases contain some circular flows (a to a) even if the input flowdat did not.


flowmapper documentation built on June 11, 2025, 5:08 p.m.