graph.feature {linkcomm} | R Documentation |
Make Node or Edge Graph Features
Description
This function returns vectors of node sizes or edge widths for use in plot.linkcomm
.
Usage
graph.feature(x, type = "nodes", clusterids = 1:length(x$clusters),
nodes = NULL, indices, features, default = 15, showall = FALSE)
Arguments
x |
An object of class |
type |
A character string specifying either |
clusterids |
An integer vector of community IDs that will be plotted. Defaults to all communities. |
nodes |
A character vector specifying node(s) that will be plotted. Overrides |
indices |
An integer vector specifying the indices of the nodes or edges that will be given specific size or width values. See |
features |
An integer vector specifying the node or edge sizes for the nodes or edges that are to be changed. If there is a single value then this will be applied to all nodes or edges specified in |
default |
An integer value specifying the node size or edge width that all nodes or edges not specified by |
showall |
Logical, whether edges that don't belong to communities will also be plotted or not. Defaults to FALSE. |
Value
A named integer vector of node sizes or edge widths. The names will be either node names or edge indices.
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
plotLinkCommGraph
, getNodesIn
, getEdgesIn
, vignette(topic = "linkcomm", package = "linkcomm")
.
Examples
## Generate graph and extract link communities.
g <- swiss[,3:4]
lc <- getLinkCommunities(g)
## Make node size vector for all nodes that belong to community 1.
graph.feature(lc, indices = getNodesIn(lc, type = "indices"), features = 20, default = 5)
## Make edge width vector for all edges that belong to community 1.
graph.feature(lc, type = "edges", indices = getEdgesIn(lc), features = 5, default = 1)