Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as_membership

Declare a numeric vector as a membership vector


Description

This is useful if you want to use functions defined on membership vectors, but your membership vector does not come from an igraph clustering method.

Usage

as_membership(x)

Arguments

x

The input vector.

Value

The input vector, with the membership class added.

Examples

## Compare to the correct clustering
g <- (make_full_graph(10) + make_full_graph(10)) %>%
  rewire(each_edge(p = 0.2))
correct <- rep(1:2, each = 10) %>% as_membership
fc <- cluster_fast_greedy(g)
compare(correct, fc)
compare(correct, membership(fc))

igraph

Network Analysis and Visualization

v1.2.10
GPL (>= 2)
Authors
See AUTHORS file.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.