Learn R Programming

cograph (version 2.7.2)

membership: Get Community Membership

Description

Extracts a named membership vector from a communities result. Works with both cograph_communities data frames and igraph communities objects.

Usage

membership(x)

Value

Named integer vector of community assignments.

Arguments

x

A cograph_communities or igraph communities object.

Examples

Run this code
g <- igraph::make_graph("Zachary")
comm <- community_louvain(g)
membership(comm)

Run the code above in your browser using DataLab