| diagram | R Documentation |
A function to plot and manipulate Hasse and Concept diagrams of ordered relations, or the Egg-box of a semigroup structure.
diagram(x, type = c("hasse", "concept", "egg-box"), attrs = NULL, main = NULL,
incmp, shape = c("rectangle", "circle", "box", "ellipse"), col, col0,
fcol, ecol, lty, lbs, ffamily, fstyle, fsize, cex.main, col.main, bg,
mar, sep, ...)
x |
Matrix representing ordered relations. |
type |
Type of diagram:
|
For "egg-box" type diagram, the following arguments are ignored:
attrs |
(optional) a list of lists with diagram attributes for |
main |
(optional) Main title of the plot diagram. |
incmp |
(optional and logical) Should incomparable elements be included in the lattice diagram? |
shape |
(optional) Shape of diagram vertices: |
col |
(optional) Colourr of diagram vertices. |
col0 |
(optional) Colour of contour in diagram vertices. |
fcol |
(optional) Font colour of text in diagram vertices. |
ecol |
(optional) Edge colour of diagram edges. |
lty |
(optional) Integer for the shape of diagram edges. |
lbs |
(optional) Labels of elements in |
ffamily |
(optional) Font family of vertex labels in diagram. |
fstyle |
(optional) Font style of vertex labels in diagram with options: |
fsize |
(optional) Font size of vertex labels in diagram. |
cex.main |
(optional) Font size of title in plot diagram. |
col.main |
(optional) Font colour of title in plot diagram. |
bg |
(optional) Background colour of plot diagram. |
mar |
(optional) Margins of plot vindue. |
sep |
(optional only for |
... |
(optional) Additional graphical items. |
diagram is a wrapper function for plotting and manipulating “Hasse”, “Concept”, and “Egg-box” diagrams.
The first two diagram types represent systems of ordered relations and are displayed as partial or linear order diagrams.
For example, the partial order table produced by the ‘strings’ option in the partial.order function can be plotted as a Hasse diagram.
Another example comes from Galois derivations in Formal Concept Analysis, where a Concept diagram shows the ordering of formal concepts defined by intents and extents.
Roman numerals are rendered for diagram elements when the partial order table in x is not labelled.
On the other hand, the Egg-box “diagram” represents equivalence classes in an abstract semigroup without a partial order structure, and such representation is in the Console, not on the Graphic Device as the other representations.
Depending on the type diagram:
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 |
This function requires Rgraphviz package installed.
hasse, partial.order, strings, galois,
green.rel, diagram.levels, as.strings, ccgraph.
# load a dataset
data("incubA")
# a partial order of strings from dataset image matrix
po <- incubA |> getElement("IM") |>
as.strings() |>
partial.order(type="strings")
# plot the order relation as a Hasse diagram
## Not run: if(require(Rgraphviz)) {
plot(diagram(po, type="hasse"))
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.