groups: Groups of a vertex partitioning

Description Usage Arguments Details Value See Also Examples

View source: R/community.R

Description

Create a list of vertex groups from some graph clustering or community structure.

Usage

1
groups(x)

Arguments

x

Some object that represents a grouping of the vertices. See details below.

Details

Currently two methods are defined for this function. The default method works on the output of components. (In fact it works on any object that is a list with an entry called membership.)

The second method works on communities objects.

Value

A named list of numeric or character vectors. The names are just numbers that refer to the groups. The vectors themselves are numeric or symbolic vertex ids.

See Also

components and the various community finding functions.

Examples

1
2
3
4
5
6
g <- make_graph("Zachary")
fgc <- cluster_fast_greedy(g)
groups(fgc)

g2 <- make_ring(10) + make_full_graph(5)
groups(components(g2))

Example output

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

$`1`
[1]  1  5  6  7 11 12 17 20

$`2`
 [1]  9 15 16 19 21 23 24 25 26 27 28 29 30 31 32 33 34

$`3`
[1]  2  3  4  8 10 13 14 18 22

$`1`
 [1]  1  2  3  4  5  6  7  8  9 10

$`2`
[1] 11 12 13 14 15

igraph documentation built on Nov. 24, 2021, 1:06 a.m.

Related to groups in igraph...