getEdgesIn: Extract Edge Indices from Communities

Description Usage Arguments Value Author(s) References Examples

View source: R/linkcomm_misc.R

Description

This function returns edge indices that belong to certain communities or that are incident upon certain nodes.

Usage

1
getEdgesIn(x, clusterids = 1, nodes = NULL, all = FALSE)

Arguments

x

An object of class linkcomm or OCG.

clusterids

An integer vector of community IDs. Defaults to community 1.

nodes

A character vector specifying node(s) for which edge indices should be returned. Overrides clusterids. Defaults to NULL.

all

Logical, whether the edges for all communities to which the named nodes belong should be returned. Will have an effect only if nodes is not NULL. If FALSE, edges that are directly incident upon the named nodes will be returned. Defaults to FALSE.

Value

An integer vector of 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.

Examples

1
2
3
4
5
6
## Generate graph and extract link communities.
g <- swiss[,3:4]
lc <- getLinkCommunities(g)

## Get edges from community 1.
getEdgesIn(lc)

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