R: Extract Nodes from Communities

getNodesIn {linkcomm} | R Documentation

## Extract Nodes from Communities

### Description

This function returns node names that belong to sets of communities.

### Usage

    getNodesIn(x, clusterids = 1, type = "names")

### Arguments

`x` | An object of class `linkcomm` or `OCG`.
`clusterids` | An integer vector of community IDs. Defaults to community 1.
`type` | A character string specifying how nodes are returned. Can be one of `"names"` or `"indices"`.

### Value

A character vector of node names (if type is `"names"`) or a numerical vector of node indices (if type is `"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

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

    ## Get nodes from community 1.
    getNodesIn(lc)

[Package linkcomm version 1.0-14 Index]