shuffle_hype: Shuffle A Hypergraph

View source: R/resamples.R

shuffle_hypeR Documentation

Shuffle A Hypergraph

Description

A hypergraph can be shuffled to slightly perturb its structure. These shuffled hypergraphs can then be used to estimate the uncertainty of calculations on the original hypergraph.

Usage

shuffle_hype(hype, n = 1, method = "hyperedge")

Arguments

hype

A hypergraph object.

n

The number of shuffled hypergraphs to calculate.

method

The method to use to shuffle the hypergraph.

Details

Two methods are used to shuffle a hypergraph, the "vertex" method keeps the degree of each vertex the same, randomly reassigning the hyperedges they are members of. The "hyperedge" method keeps the cardinality of each hyperedge the same, randomly reassigning the vertices that are members.

Value

A list of shuffled hypergraphs.

Examples

hype <- example_hype()
resamples <- shuffle_hype(hype, n = 5)
lapply(resamples, incidence_matrix)

hwarden162/hyper documentation built on Sept. 15, 2022, 5:21 a.m.