Louvain clustering with bin and unimodal merging
Source:R/cluster_louvain.R
cluster_louvain_merge.RdEnd-to-end wrapper that applies Louvain clustering
(cluster_louvain()), then merges clusters by variable bin
thresholds (cluster_merge_bin()), and finally merges unimodal
neighbours (cluster_merge_unimodal()).
Usage
cluster_louvain_merge(
data,
vars = NULL,
thresholds,
k = 15L,
resolution = 1,
max_label_diff = 2L,
ignore_labels = NULL,
dip_threshold = 0.15,
min_mode_dist = NULL,
max_iterations = 50L
)Arguments
- data
matrix or data.frame. Rows are observations, columns are variables.
- vars
character vector or
NULL. Column names to use for clustering. IfNULL(default), all columns are used.- thresholds
named list. Passed to
cluster_merge_bin(). Each element is a numeric vector of threshold values for the variable given by the element name.- k
integer(1). Number of nearest neighbours used to build the kNN graph. Default
15L.- resolution
numeric(1). Resolution parameter passed to
igraph::cluster_louvain(). Higher values yield more (smaller) clusters. Default1.- max_label_diff
integer(1). Passed to
cluster_merge_unimodal(). Default2L.- ignore_labels
character vector or
NULL. Passed tocluster_merge_unimodal(). DefaultNULL.- dip_threshold
numeric(1). Passed to
cluster_merge_unimodal(). Default0.15.- min_mode_dist
numeric or named numeric vector or
NULL. Passed tocluster_merge_unimodal(). DefaultNULL.- max_iterations
integer(1). Passed to
cluster_merge_unimodal(). Default50L.
Value
The list returned by cluster_merge_unimodal(), with
elements assign and label and a "thresholds" attribute.