poset_from_igraph: Generates a Partially Ordered SET from a Directed Acyclic...

View source: R/poset_from_igraph.R

poset_from_igraphR Documentation

Generates a Partially Ordered SET from a Directed Acyclic Graph (DAG)

Description

This function generates a poset from an objectg. The function checks if the graph is directed and cyclic in oreder it represent the cover-relation.

Usage

poset_from_igraph(g)

Arguments

g

an igraph object

Details

Note that the Hasse diagram represents the cover relation from the top to the bottom, therefore its representation is the opposite of the plot of the graph with Sugiyama layout.

Value

an environment of class poset.

References

\insertRef

davey2002introductionPOSetR

See Also

poset.

Examples

library(igraph)
g <- make_tree(10)
ly <- igraph::layout_with_sugiyama(g)$layout
g$layout <- ly
plot(g)
p <- poset_from_igraph(g)
plot(p)

POSetR documentation built on Jan. 17, 2023, 5:18 p.m.