Learn R Programming

POSetR (version 1.1.4)

poset_from_igraph: 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)

Value

an environment of class poset.

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.

References

davey2002introductionPOSetR

See Also

poset.

Examples

Run this code
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)

Run the code above in your browser using DataLab