Learn R Programming

parsec (version 1.2.0)

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

Description

This function is introduced in the package in order to clarify the relation of an object of class cover and the adjacency matrix of the corresponding graph describing the cover relation.

Objects of class cover are boolean matrices indicating if the element of the row is covered by the element of the corresponding column. This definition is the transpose of the adjacency matrix of a graph describing the cover relation. This characteristic is not changed in order to guarantee the compatibility of the package with the scripts created with the previous versions of the package.

Moreover, this function allows to use the package igraph to plot and analyse the partial order.

Usage

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

Arguments

p

an object of class cover or incidence.

additional arguments of the function vertices.

Value

The function returns an object of class igraph that represents the directed graph describing the cover relation.

The function add to the graph a layout generated with the function vertices in order to plot the graph of the cover relation similarly to an Hasse diagram.

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
# NOT RUN {
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