Learn R Programming

stagedtrees (version 2.2.1)

plot.ceg: igraph's plotting for CEG

Description

igraph's plotting for CEG

Usage

# S3 method for ceg
plot(x, col = NULL, ignore = x$name_unobserved, layout = NULL, ...)

Arguments

x

an object of class ceg.

col

colors specification see plot.sevt.

ignore

vector of stages which will be ignored and left untouched, by default the name of the unobserved stages stored in x$name_unobserved.

layout

an igraph layout.

...

additional arguments passed to plot.igraph.

Details

This function is a simple wrapper around igraph's plot.igraph. The ceg object is converted to an igraph object by firstly obtaining the adjacency matrix representation with ceg2adjmat. If not specified, the default layout used is a rotated layout.reingold.tilford.

We use palette() as palette for the igraph plotting, while plot.igraph uses as default a different palette. This is to allow matching stages colors between plot.ceg and plot.sevt.

Examples

Run this code
if (FALSE) {
 model <- stages_bhc(full(Titanic))
 model.ceg <- ceg(model)
 plot(model.ceg, edge.arrow.size = 0.1, vertex.label.dist = -2)
 }

Run the code above in your browser using DataLab