Learn R Programming

relations (version 0.2-0)

plot: Visualize Relations

Description

Visualize certain endorelations by plotting a Hasse Diagram of their transitive reduction.

Usage

## S3 method for class 'relation':
plot(x, attrs = list(graph = list(rankdir = "BT"),
                                        edge = list(arrowsize = "0"),
                                        node = list(shape = "rectangle",
                                                    fixedsize = FALSE)),
                        ...)

Arguments

x
an Robject inheriting from class relation.
attrs
argument passed to the plot method for class graphNEL.
...
Other arguments passed to the graphNEL plot method.

Details

Visualization is currently only provided for either antisymmetric or complete transitive endorelations and requires that package Rgraphviz is available. In case of transitive complete relations (preferences), the dual complement is plotted. Note that the default settings create a diagram with nodes ordered bottom-up and with no arrows.

See Also

relation

Examples

Run this code
if(require("Rgraphviz")) {
  ## simple example
  plot(as.relation(1 : 5))

  ## inclusion on a power set:
  ps <- 2 ^ set("a", "b", "c")
  inc <- set_outer(ps, set_is_subset)
  plot(relation(incidence = inc))
}

Run the code above in your browser using DataLab