Graphical rendering of a sequence regression tree

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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) for seqtreedisplay. A disstree object (as produced by disstree) for disstreedisplay.

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

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.

Value

None

Author(s)

Matthias Studer (with Gilbert Ritschard for the help page)

See Also

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

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.