% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/communities.R
\name{membership}
\alias{membership}
\title{Get Community Membership}
\usage{
membership(x)
}
\arguments{
\item{x}{A cograph_communities or igraph communities object.}
}
\value{
Named integer vector of community assignments.
}
\description{
Extracts a named membership vector from a communities result.
Works with both \code{cograph_communities} data frames and
igraph communities objects.
}
\examples{
\dontshow{if (requireNamespace("igraph", quietly = TRUE)) withAutoprint(\{ # examplesIf}
g <- igraph::make_graph("Zachary")
comm <- community_louvain(g)
membership(comm)
\dontshow{\}) # examplesIf}
}
