Tables of a hypergraph community ensemble
Source:R/hypergraph_communities.R
hg_get.hg_communities.RdReads, prints and plots the result of hg_communities() on a hypergraph.
Arguments
- x
An
hg_communitiesobject.- n
Number of rows of the default table to print. Default
10.- ...
For
plot(), additional arguments passed tocograph::splot(); otherwise unused.- what
Table to return:
"medoid"(default: one row per node with its community in the AMI-medoid run),"partitions","runs","sizes","ami","ari","nmi", or (IRMM fits only)"weights". The three similarity tables have one row per distinct pair of runs (run_a,run_b, and the similarity), without the diagonal.
Value
hg_get(): a base data.frame. print(): x, invisibly.
plot(): the cograph plot of the projection, coloured by the medoid
communities.
Examples
dat <- data.frame(
member = c("a", "b", "c", "a", "b", "c", "x", "y", "z", "x", "y", "z"),
edge = rep(paste0("e", 1:4), each = 3)
)
h <- group_hypergraph(dat, "member", "edge")
if (requireNamespace("igraph", quietly = TRUE)) {
fit <- hg_communities(h, n_runs = 2, trials = 2, seeds = 1:2)
hg_get(fit, what = "runs")
}
#> run seed n_communities codelength
#> 1 1 1 2 2.052397
#> 2 2 2 2 2.052397