Learn R Programming

hypergraph (version 1.44.0)

l2hel: Create lists of Hyperedge objects

Description

Conveniently create lists of Hyperedge-class instances.

Usage

l2hel(e)

Arguments

e
A list of character vectors. Each element of the list represents a hyperedge and the character vector value specifies the nodes of the hypergraph that are part of the hyperedge. The names of the list elements, if found, will be used as the label for the corresponding Hyperedge object.

Value

A list of Hyperedge-class objects. If the list e did not have names, the labels of the Hyperedges will be set to its index in the list coerced to character.

See Also

Hyperedge-class Hypergraph-class

Examples

Run this code
edges <- list("e1"="A", "e2"=c("A", "B"), "e3"=c("C", "D"))
hEdgeList <- l2hel(edges)

Run the code above in your browser using DataLab