Learn R Programming

TraMineR (version 1.8-9)

disstree2dot: Graphical representation of a dissimilarity tree

Description

Functions to generate a "dot" file and associated images files that can be used in GraphViz to get a graphical representation of the tree.

Usage

disstree2dot(tree, filename, digits=3, imagefunc=NULL, imagedata=NULL,
            imgLeafOnly=FALSE, devicefunc="jpeg", imageext="jpg",
            device.arg=list(), use.title=TRUE, label.loc="main",
            node.loc="main", split.loc="sub", title.cex=1, legendtext=NULL,
            legendimage=NULL, qualityimage=NULL, showdepth=FALSE,
            title.outer=FALSE, ...)

disstree2dotp(tree, filename, imagedata=NULL, imgLeafOnly=FALSE,
            imagefunc=plot, title.cex=3, withquality=TRUE,
            quality.fontsize=title.cex, title.outer=FALSE, ...)

seqtree2dot(tree, filename, seqdata=tree$info$object, imgLeafOnly=FALSE,
            sortv=NULL, dist.matrix=NULL, title.cex=3, withlegend="auto",
            legend.fontsize=title.cex, withquality=FALSE,
            quality.fontsize=title.cex, axes=FALSE, ...)

Arguments

tree
The tree to be plotted.
filename
A filename, without extension, that will be used to generate image and dot files.
digits
Number of significant digits to plot.
imagefunc
A function to plot the individuals in a node, see details.
imagedata
a data.frame that will be passed to imagefunc, see details.
imgLeafOnly
Logical: If TRUE, only terminal node will be plotted.
devicefunc
A device function, "jpeg" by default.
imageext
extension for image files.
device.arg
Argument passed to devicefunc.
use.title
Logical: If TRUE, node information will be printed using title command, see details.
label.loc
Location of the node label, see title for possible values.
node.loc
Node content location, see title for possible values.
split.loc
Split information location, see title for possible values.
title.cex
cex applied to all calls to title (see use.title).
title.outer
Logical: If TRUE, the title (see use.title) is printed in the outer margins.
legendtext
An optional text appearing in a distinct node.
legendimage
An optional image file appearing in a distinct node.
qualityimage
An optional image file appearing in a distinct node.
showdepth
Logical. If TRUE, information about depth of the tree is added to the plot.
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.
seqdata
a sequence object as defined by the the seqdef function.
sortv
The name of an optional variable used to sort the data before plotting, see seqplot.
dist.matrix
The name of an optional dissimilarity matrix used to find representative sequences, seqrplot.
withlegend
defines if and where the legend of the state colors is plotted. The default value "auto" sets the position of the legend automatically. Other possible value is "right". Obsolete value TRUE is equivalent to "aut
legend.fontsize
Size of the font of the legend.
axes
if set to "all" (default value) x axes are drawn for each plot in the graphic. If set to "bottom" and group is used, axes are drawn only under the plots located at the bottom of the graphic area. If FALSE
...
other parameters that will be passed to imagefunc or seqplot (for seqtree2dot).

Value

  • Nothing but generates a "dot" and several image files (one per node) in the current working directory (see getwd and setwd).

Details

These functions generate a "dot" file that can be used in GraphViz (http://www.graphviz.org). It also generates one image per node through a call to imagefunc passing the selected lines of imagedata if present or otherwise a list of indexes (of individuals belonging to a node). These functions are not intended to be used by end-user. See seqtreedisplay and disstreedisplay for a much simpler way to generate a graphical representation of a tree (seqtree or disstree). seqtree2dot is a shortcut for sequences objects using the plot function seqplot. For each node, it calls seqplot with the corresponding subset of rows of seqdata and the provided seqplot's arguments. You should at least specify the type of the plot (e.g. type="d", see seqplot for more details). If use.title is TRUE, imagefunc should take care to leave enough space for the title. disstree2dotp is a simplified interface of disstree2dot which automatically leaves enough space for the title and subtitles. These functions are intended to be generic.

See Also

seqtree and seqtreedisplay, disstree and disstreedisplay.