Description Usage Arguments Value Author(s) References Examples
MCLEAN performs hierarchical clustering and transforms the output into a network.
1 2 |
distance_matrix |
a dissimilarity structure as produced by dist. |
threshold |
numeric scalar cutoff used to cluster elements. It is equivalent to the height in the dendrogram. |
method |
the agglomeration method to be used. This should be (an unambiguous abbreviation of) one of "ward.D", "ward.D2", "single", "complete", "average" (= UPGMA), "mcquitty" (= WPGMA), "median" (= WPGMC) or "centroid" (= UPGMC). |
tree |
a tree as produced by hclust. If the tree is not provided, the function generates it automatically through hclust() function. |
node_simplification |
logical value to disable the node aggregation. The default is TRUE. |
It returns a list containing the following elements:
nodes: a data frame with the definition of the nodes. The variable "name
is the node identifier used internally; nodes
is best candidate rowname used in simplification procedure; size
indicates the number of data elements in the node; components
cluster id (connected component identification), infomap
result of infomap algorithm.
links: a data frame with the links of the network defined by source
and target
. The variable size
determine the number of data elements connected.
idnodes: a data frame with the id and clusters of each data element. The varaible id
represents the id (rowname) of the element in the distance matrix; name
identifier of the node where the data element is assigned; components
cluster id, infomap
result of the infomap algorithm.
Daniel Alcaide, daniel.alcaide@esat.kuleuven.be
Alcaide D, Aerts J. (2018) MCLEAN: Multilevel Clustering Exploration As Network. PeerJ Computer Science 4:e145 https://doi.org/10.7717/peerj-cs.145
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | data("synthetic_distances")
output = mclean(distance_matrix = synthetic_distances, threshold = 187, method = "single")
plot_network(output)
# Without node aggregation
distance_matrix = as.dist(matrix ( c( 0, 2, 3, 5, 7, 8,10, 9,11,11,
2, 0, 2, 5, 6, 7, 9, 8, 9,10,
3, 2, 0, 2, 6,10,13,10, 9,11,
5, 5, 2, 0, 4, 6, 8, 6, 7, 9,
7, 6, 6, 4, 0, 6, 7, 6, 6, 8,
8, 7,10, 6, 6, 0, 3, 5, 5, 6,
10, 9,13, 8, 7, 3, 0, 2, 6, 4,
9, 8,10, 6, 6, 5, 2, 0, 4, 6,
11, 9, 9, 7, 6, 5, 6, 4, 0, 7,
11,10,11, 9, 8, 6, 4, 6, 7, 0), byrow = TRUE, ncol = 10))
plot_network( mclean(distance_matrix = distance_matrix, threshold = 4.1, method = "average", node_simplification = FALSE) )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.