Learn R Programming

parsec (version 1.2.7)

parsec2igraph: Converting a partial order to an object of the package igraph.

Description

The function turns a cover matrix to an igraph object, so as to allow using the graphical power of igraph to plot Hasse diagrams. Objects of class cover are boolean matrices where element ij is equal to 1 if element i is covered by element j. This makes the cover matrix the transpose of the adjacency matrix of a graph, describing the cover relation in igraph.

Usage

parsec2igraph(p, ...)
# S3 method for cover
parsec2igraph(p, ...)
# S3 method for incidence
parsec2igraph(p, ...)

Value

The function returns an object of class igraph, representing the directed graph defined by the cover relation.

The function adds to the graph a layout generated through function vertices, so as to plot the graph according to the conventions used for Hasse diagrams.

Arguments

p

an object of class cover or incidence.

...

additional arguments of the function vertices.

Author

Arcagni, A.

References

Csardi G, Nepusz T: The igraph software package for complex network research, InterJournal, Complex Systems 1695. 2006. http://igraph.org

See Also

igraph, vertices

Examples

Run this code
example(merge.wprof)
poset <- getzeta(distribution)
incidence2cover(poset)

G <- parsec2igraph(poset, noise = TRUE)
get.adjacency(G)
# tkplot(G, vertex.size = distribution$freq, vertex.color = "white")

G <- parsec2igraph(poset, noise = 10)
# tkplot(G, vertex.size = distribution$freq, vertex.color = "white")

Run the code above in your browser using DataLab