plotCluster: Plot the clusters in one projection of the bipartite network

View source: R/plot-cluster.R

plotClusterR Documentation

Plot the clusters in one projection of the bipartite network

Description

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.

Usage

plotCluster(graph, cluster, ...)

Arguments

graph

An igraph object.

cluster

An igraph cluster object.

...

Pass to forceNetwork

Value

A networkD3 object.

See Also

forceNetwork

Examples

# 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)

jafarilab/NIMAA documentation built on July 29, 2023, 5:36 a.m.