plotCluster | R Documentation |
This function makes an interactive network figure that shows nodes in which nodes belonging to the same cluster are colored the same and nodes belonging to other clusters are colored differently. This function has been customized to use the output of findCluster
.
plotCluster(graph, cluster, ...)
graph |
An igraph object. |
cluster |
An igraph cluster object. |
... |
Pass to |
A networkD3 object.
forceNetwork
# generate an incidence matrix
data <- matrix(c(1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0), nrow = 3)
colnames(data) <- letters[1:5]
rownames(data) <- LETTERS[1:3]
# run findCluster() to do clustering
cls <- findCluster(
data,
part = 1,
method = "all",
normalization = FALSE,
rm_weak_edges = TRUE,
comparison = FALSE
)
# plot the cluster with Louvain method
plotCluster(graph = cls$graph, cluster = cls$louvain)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.