graph.feature: Make Node or Edge Graph Features

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/linkcomm_misc.R

Description

This function returns vectors of node sizes or edge widths for use in plot.linkcomm.

Usage

1
2
graph.feature(x, type = "nodes", clusterids = 1:length(x$clusters), 
              nodes = NULL, indices, features, default = 15, showall = FALSE)

Arguments

x

An object of class linkcomm.

type

A character string specifying either "nodes" or "edges".

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 clusterids. Defaults to NULL.

indices

An integer vector specifying the indices of the nodes or edges that will be given specific size or width values. See getNodesIn and getEdgesIn for ways to generate these indices. Also see examples in vignette(topic = "linkcomm", package = "linkcomm").

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 indices, otherwise the features vector must be the same length as the indices vector and the values will be matched to each other.

default

An integer value specifying the node size or edge width that all nodes or edges not specified by indices will take. Defaults to 15.

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

1
2
3
4
5
6
7
8
9
## 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)

alextkalinka/linkcomm documentation built on Feb. 11, 2021, 4:53 a.m.