find.hclust | R Documentation |
find the hierarchical cluster analysis among the nodes of graph based on the length of all the shortest paths in the graph.
find.hclust(
x,
graph.mst = FALSE,
weights = NULL,
hclust.method = "average",
...
)
x |
a igraph object |
graph.mst |
logical whether obtain the minimum spanning tree first then find.hclust, default is FALSE. |
weights |
a numeric vector giving edge weights or a character.
If this is |
hclust.method |
the agglomeration method to be used, This should be (an
unambiguous abbreviation of) one of |
... |
additional parameters |
hclust object
library(igraph)
set.seed(123)
g <- igraph::sample_gnp(100, .1) %>%
set_edge_attr(name='weight', value=abs(rnorm(E(.),3)))
tr1 <- find.hclust(g, weights = NA)
tr2 <- find.hclust(g)
tr3 <- find.hclust(g, graph.mst = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.