plotCluster: Plot cluster network

View source: R/betaMix.R

plotClusterR Documentation

Plot cluster network

Description

Plot a cluster network with all the nodes and edges - the central node is marked by a black circle. The radius of each point corresponds to its degree. The opacity corresponds to the percentage of edges from the node that is in the cluster (the darker it is, the larger the percentage of edges is within the cluster.) The distance from the center corresponds to the relative dissimilarity with the central node. This is computed as the number of neighbors the node and the central node do not have in common.

Usage

plotCluster(
  AdjMat,
  clustNo,
  clusterInfo = NULL,
  labels = FALSE,
  nodecol = "blue",
  labelsize = 1,
  figtitle = NULL,
  edgecols = "grey88"
)

Arguments

AdjMat

An adjacency Matrix (0/1).

clustNo

The chosen cluster.

clusterInfo

Obtained from graphComponents.

labels

If set to TRUE, show node names (default=FALSE).

nodecol

The color(s) of the nodes. Can be a single value or a vector of length equal to the number of rows in AdjMat

labelsize

Text size of node labels.

figtitle

The title of the plot (default=NULL).

edgecols

The colors to be used for edges. Default="grey88". If one value is given, all edges will be drawn using this color. If edgecol contains two valid colors, the first is used for positive correlations, and the second for negative ones.

Examples

## Not run: 
   data(SIM,package = "betaMix")
   res <- betaMix(betaMix::SIM, maxalpha = 1e-5,ppr = 0.01,subsamplesize = 30000, ind=TRUE)
   adjMat <- getAdjMat(res, signed=TRUE)
   SimComp <- graphComponents(adjMat)
   plotCluster(adjMat, 2, SimComp)
   plotCluster(adjMat, 2, SimComp, edgecols = c("blue","orange"), labels=TRUE)

## End(Not run)

haimbar/betaMix documentation built on Jan. 3, 2023, 12:54 p.m.