Learn R Programming

multiplex (version 3.7)

diagram: Plot Diagrams of Ordered or Linked Relations

Description

A function to plot and manipulate Hasse and Concept diagrams of ordered relations, or the Egg-box of a semigroup structure.

Usage

diagram(x, type = c("hasse", "concept", "egg-box"), attrs = NULL, main = NULL, 
       incmp, cex.main, bg, mar, shape, col, col0, fcol, ecol, lty, lbs, 
       ffamily, fstyle, fsize, col.main, sep, ...)

Value

Depending on the type:

hasse

a Hasse diagram of partially ordered relations

concept

a Concept diagram of formal concepts in a formal context

egg-box

an Egg-box of an abstract semigroup

Arguments

x

a matrix representing ordered relations

type

type of diagram:

  • hasse Hasse diagram of partially ordered relations

  • concept Concept lattice of a formal context

  • egg-box Egg-box diagram of an abstract semigroup

For egg-box, the following arguments are ignored.

attrs

(optional) attributes of the diagram

main

(optional) title of the diagram

incmp

(logical) whether or not incomparable elements should be included in the lattice diagram

cex.main

(optional) font size of diagram's title

bg

(optional) background color of diagram

mar

(optional) margins of plot

shape

(optional) shape of vertices

col

(optional) color of vertices

col0

(optional) color of vertices' contour

fcol

(optional) color of text's vertices

ecol

(optional) color of edges

lty

(optional) shape of edges

lbs

(optional) labels of elements in partially ordered set

ffamily

(optional) font family of vertex labels

fstyle

(optional) font style of vertex labels with options:

  • bold

  • italic

  • bolditalic

fsize

(optional) font size of vertex labels

col.main

(optional) font color of main title

sep

(optional) pair separator for pairwise relations inside intents and extents

...

(optional) additional graphical items

Author

Antonio Rivero Ostoic

Warning

Requires Rgraphviz package installed.

Details

diagram is a wrapper function to plot and manipulate “Hasse”, “Concept”, and “Egg-box” types of diagrams.

The first two diagrams are for systems of ordered relations, and the plotted deviced is either a partial order or a linear order diagram. An example of ordered relations is found in the partial order table of relations product of the ‘strings’ option in the partial.order function, and which is plotted as a Hasse diagram. Another set of ordered relations comes from the table produced on Galois derivations within Formal Concept analysis where a Concept diagram represents the ordering relations among formal concepts made of intents and extents.

The Egg-box diagram is for equivalence classes in an abstract semigroup not associated to a partial order structure.

See Also

hasse, partial.order, strings, galois, green.rel, diagram.levels, as.strings, ccgraph.

Examples

Run this code
# load a dataset
data("incubA")

# given e.g. a partial order table in the object 'po'
po <- as.strings(incubA$IM) |> 
  partial.order(type="strings")

# plot the order relation as a Hasse diagram
if (FALSE) if(require(Rgraphviz)) {
plot(diagram(po, type="hasse"))
}

Run the code above in your browser using DataLab