Learn R Programming

TraMineR (version 1.8-9)

seqtreedisplay: Graphical rendering of a sequence regression tree

Description

Generate a graphical representation of a regression tree of state sequence data.

Usage

seqtreedisplay(tree, filename=NULL, seqdata=tree$info$object,
               imgLeafOnly=FALSE, sortv=NULL, dist.matrix=NULL,
               title.cex=3, withlegend="auto", legend.fontsize=title.cex,
               axes=FALSE, imageformat="png", withquality=TRUE,
               quality.fontsize=title.cex, legendtext=NULL,
               showtree=TRUE, showdepth=FALSE, ...)

disstreedisplay(tree, filename=NULL, imagedata=NULL, imagefunc=plot,
                imgLeafOnly=FALSE, title.cex=3, imageformat="png",
                withquality=TRUE, quality.fontsize=title.cex,
                legendtext=NULL, showtree=TRUE, showdepth=FALSE, ...)

Arguments

tree
A seqtree object (as produced by seqtree).
filename
The name of a file where to save the plot (overwritting existing file). If NULL, a temporary file is created.
seqdata
The sequence object containing the state sequences plotted in the nodes.
imgLeafOnly
Logical. If TRUE sequences are plotted only in terminal nodes.
sortv
Argument passed to seqplot
dist.matrix
Argument passed to seqplot
title.cex
The cex value for the node titles (see par).
withlegend
Logical. Should the color legend be displayed on the plot?
legend.fontsize
Font cex value for the legend.
axes
Argument passed to seqplot
imageformat
Image format of the output file (filename)
withquality
If TRUE, a node displaying fitting measures of the tree is added to the plot.
quality.fontsize
Numeric. Size of the font of the fitting measures node.
legendtext
Character. Optional text information that should be added.
showtree
Logical. Should the tree be shown on the screen?
showdepth
Logical. If TRUE, the splits are ordered according to their global pseudo-R2.
imagefunc
A function to plot the individuals in a node, see details.
imagedata
a data.frame that will be passed to imagefunc.
...
additional arguments passed to seqplot

Value

  • None

Details

This function generates a tree image. For each node, it invokes seqplot for the selected lines of seqdata as argument. You should at least specify the type of the plot to use (type="d" for instance, see seqplot for more details). The plot is actually not generated as an R plot, but with GraphViz (www.graphviz.org). Hence, seqtreedisplay only works when GraphViz is correctly installed. Conversion to image formats other than "jpeg" or "png" is done using ImageMagick (www.imagemagick.org). To use this feature, ImageMagick (www.imagemagick.org) should hence also be installed.

See Also

See seqtree and disstree for examples, and disstree2dot for generating "dot" files.