text_tree: Implementation of Print Labels on MonoClust Tree

Description Usage Arguments Value

View source: R/utils.R

Description

This function plots the labels onto the MonoClust tree. It is partially inspired by rpart package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
text_tree(
  x,
  which = 4,
  digits = getOption("digits") - 2,
  stats = TRUE,
  abbrev,
  cols = NULL,
  cols.type = c("l", "p", "b"),
  rel.loc.x = TRUE,
  show.pval = TRUE,
  uniform = FALSE,
  minbranch = 0.3,
  ...
)

Arguments

x

MonoClust result object.

which

Labeling modes, which are:

  • 1: only splitting variable names are shown, no splitting rules.

  • 2: only splitting rules to the left branches are shown.

  • 3: only splitting rules to the right branches are shown.

  • 4 (default): splitting rules are shown on both sides of branches.

digits

Number of significant digits to print.

stats

Whether to show statistics (cluster sizes and medoid points) on the tree.

abbrev

Whether to print the abbreviated versions of variable names. Can be either "no" (default), "short", or "abbreviate". Short forms of them can also be used.

If "no", the labels recorded in x$labels are used.

If "short", variable names will be turned into "V1", "V2", ...

If "abbreviate", abbreviate() function will be used. Use the optional arguments for this function.

cols

Whether to shown color bars at leaves or not. It helps matching this tree plot with other plots whose cluster membership were colored. It only works when text is TRUE. Either NULL, a vector of one color, or a vector of colors matching the number of leaves.

rel.loc.x

Whether to use the relative distance between clusters as x coordinate of the leaves. Default is TRUE.

show.pval

If MonoClust object has been run through perm.test(), whether to show p-value on the tree.

uniform

If TRUE, uniform vertical spacing of the nodes is used; this may be less cluttered when fitting a large plot onto a page. The default is to use a non-uniform spacing proportional to the inertia in the fit.

minbranch

Set the minimum length for a branch to minbranch times the average branch length. This parameter is ignored if uniform = TRUE. Sometimes a split will give very little improvement, or even no improvement at all. A tree with branch lengths strictly proportional to improvement leaves no room to squeeze in node labels.

...

Extra arguments that would be transferred to graphics::text()

Value

Labels on tree.


vinhtantran/monoClust documentation built on March 12, 2021, 11:11 p.m.