hypergraph.add.edges {HyperG} | R Documentation |
Add edges or vertices to a hypergraph.
Description
Adds hyper-edges or vertices to a hypergraph.
Usage
hypergraph.add.edges(h, edges, verbose = FALSE)
add.hyperedges(h, edges, verbose = FALSE)
hypergraph.add.vertices(h, nv, names)
Arguments
h |
A hypergraph. |
edges |
A list of edges to be added. |
nv |
Number of vertices to add. |
names |
Optional vector of names of the vertices. |
verbose |
logical. Whether to warn if new vertices are created. |
Details
The edges can be indices or edge names. This is different than the graph
call – see the igraph package help for that.
If edges is NULL, or missing,
hypergraph.add.edges
adds a single empty hyper-edge to the hypergraph.
add.hyperedges
is an alias for hypergraph.add.edges
.
Value
Returns a hypergraph (or graph) as appropriate.
Author(s)
David J. Marchette dmarchette@gmail.com
See Also
Examples
h <- hypergraph_from_edgelist(list(1:4,1:2,c(2,3,5),c(3,5:7)))
h1 <- hypergraph.add.vertices(h,1,"8")
h2 <- hypergraph.add.edges(h,list(c(1,5,8),7:9))
[Package HyperG version 1.0.0 Index]