Merge flat disjoint clusterings whose pairwise ECS score is above a given threshold. The merging is done using a complete linkage approach.

merge_partitions(
  partition_list,
  ecs_thresh = 1,
  order = TRUE,
  check_ties = FALSE
)

Arguments

partition_list

A list of flat disjoint membership vectors.

ecs_thresh

A numeric: the ecs threshold.

order

A logical: if TRUE, order the partitions based on their frequencies.

check_ties

A logical value that indicates whether to check for ties in the highest frequency partitions or not. If TRUE, the function will put at the first position the partition that has the highest similarity with the other partitions. Defaults to FALSE.

Value

a list of the merged partitions

Examples

initial_list <- list(c(1, 1, 2), c(2, 2, 2), c("B", "B", "A"))
merge_partitions(initial_list, 1)
#> [[1]]
#> [[1]]$mb
#> [1] 1 1 2
#> 
#> [[1]]$freq
#> [1] 2
#> 
#> 
#> [[2]]
#> [[2]]$mb
#> [1] 2 2 2
#> 
#> [[2]]$freq
#> [1] 1
#> 
#>