plotOCGraph {linkcomm} | R Documentation |
Plot a Graph Layout of OCG Communities
Description
This function is called by plot.OCG
to plot a graph layout of the OCG communities.
Usage
plotOCGraph(x, clusterids = 1:x$numbers[3], nodes = NULL, pie.local = TRUE,
incident = TRUE, layout = layout.fruchterman.reingold,
vertex.radius = 0.03, scale.vertices = 0.05, edge.color = "grey",
vertex.label.color = "black", vertex.label.cex = 0.8,
pal = brewer.pal(7,"Set2"), shownodesin = 0, vlabel = TRUE,
random = TRUE, ...)
Arguments
x |
An object of class |
clusterids |
An integer vector of community IDs. Defaults to all communities. |
nodes |
A character vector naming the nodes to be plotted. If NULL, then community IDs are used instead. Defaults to NULL. |
pie.local |
Logical, whether to include pie segments for just the communities to which the chosen nodes belong, or for all communities. In the latter case, communities that are not present among the chosen nodes will appear as empty segments in the node pies. Defaults to TRUE. |
incident |
Logical, whether to include just the communities of the named node(s), or the community membership of all nodes that interact with the named node(s). Defaults to TRUE. |
layout |
A character string or function identifying the layout algorithm to be used for positioning nodes in the graph. Defaults to |
vertex.radius |
A real number specifying the vertex radius. Defaults to 0.03. |
scale.vertices |
A real number specifying the fraction of increase in vertex radius for each community membership. If NULL then all vertices are the same size. Defaults to 0.05. |
edge.color |
A character string specifying the colour of edges. Defaults to |
vertex.label.color |
A character string specifying the color of node labels. Defaults to |
vertex.label.cex |
A numerical value specifying the size of the node labels. Defaults to 0.8. |
pal |
A character vector describing a colour palette to be used for colouring the link communities in the graph. Defaults to |
shownodesin |
An integer value specifying the number of communities a node must belong to before it will be displayed. If 0 then all nodes are displayed. Defaults to 0. |
vlabel |
Logical, whether node labels are to be added. Defaults to TRUE. |
random |
Logical, whether to randomise the link colours. Defaults to TRUE. |
... |
Additional arguments to be passed to |
Details
Here we describe the parameters for plotting OCG community graphs using:
plot(x, type = "graph", layout = layout)
Various graph layouts are available:
-
layout.random
-
layout.circle
-
layout.sphere
-
layout.fruchterman.reingold
-
layout.kamada.kawai
-
layout.spring
-
layout.reingold.tilford
-
layout.fruchterman.reingold.grid
-
layout.lgl
-
layout.graphopt
-
layout.mds
-
layout.svd
-
layout.norm
All of these are described in more detail in the igraph
package.
Value
A graph plot.
Author(s)
Alex T. Kalinka alex.t.kalinka@gmail.com
References
Kalinka, A.T. and Tomancak, P. (2011). linkcomm: an R package for the generation, visualization, and analysis of link communities in networks of arbitrary size and type. Bioinformatics 27, 2011-2012.
See Also
Examples
## Generate graph and extract OCG communities.
g <- swiss[,3:4]
oc <- getOCG.clusters(g)
## Plot a graph of OCG communities.
plot(oc, type = "graph")