plot | R Documentation |
Visualize certain crisp endorelations by plotting a Hasse Diagram of their transitive reduction.
## S3 method for class 'relation' plot(x, attrs = list(graph = list(rankdir = "BT"), edge = list(arrowsize = NULL), node = list(shape = "rectangle", fixedsize = FALSE)), limit = 6L, labels = NULL, main = NULL, type = c("simplified", "raw"), ...) ## S3 method for class 'relation_ensemble' plot(x, attrs = list(list(graph = list(rankdir = "BT"), edge = list(arrowsize = NULL), node = list(shape = "rectangle", fixedsize = FALSE))), type = "simplified", limit = 6L, labels = NULL, ..., layout = NULL, main = NULL)
x |
an R object inheriting from class |
attrs |
argument passed to the plot method for class
Note that for the |
type |
character vector of either "simplified" or "raw" strings, one for each relation plotted. (See details.) |
limit |
Argument passed to the labeling function creating default
labels for the nodes (see |
labels |
Optional list of character vectors defining unique labels for the nodes. List of such lists for relation ensembles. |
layout |
integer vector of length 2 specifying the number of rows
and columns of the screen layout. If |
... |
Other arguments passed to the
|
main |
character vector used for the main title(s). If |
Visualization requires that package Rgraphviz is available. If type is "simplified" (default), the transitive reduction is first computed to reduce visual complexity (especially for transitive relations). For partial orders, a Hasse diagram is plotted. In case of (acyclic) transitive complete relations (i.e., weak orders, preferences), the dual is plotted. For all other acyclic relations, the asymmetric part is plotted. (Note that the default settings in these cases create a diagram with nodes ordered bottom-up and with no arrows.) For cyclic relations, a raw graph (with arrows) of the corresponding transitive reduction is computed. If type is "raw", a directed graph without any transformation is plotted from the relation.
relation()
,
transitive_reduction()
require("sets") # set() etc. 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) R <- relation(incidence = inc) plot(relation_ensemble(R, R), type = c("simplified", "raw")) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.