Render the MonoClust split tree in an easy to read format with important information such as terminal nodes, p-value (if possible), etc.

# S3 method for MonoClust
print(
  x,
  abbrev = c("no", "short", "abbreviate"),
  spaces = 2L,
  digits = getOption("digits"),
  ...
)

Arguments

x

MonoClust result object.

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.

spaces

Spaces indent between 2 tree levels.

digits

Number of significant digits to print.

...

Optional arguments to abbreviate().

Value

A nicely displayed MonoClust split tree.

See also

Examples

library(cluster) data(ruspini) ruspini4sol <- MonoClust(ruspini, nclusters = 4) print(ruspini4sol, digits = 2)
#> n = 75 #> #> Node) Split, N, Cluster Inertia, Proportion Inertia Explained, #> * denotes terminal node #> #> 1) root 75 240000 0.63 #> 2) y < 91 35 43000 0.95 #> 4) x < 37 20 3700 * #> 5) x >= 37 15 1500 * #> 3) y >= 91 40 46000 0.79 #> 6) x < 63.5 23 3200 * #> 7) x >= 63.5 17 4600 * #> #> Note: One or more of the splits chosen had an alternative split that reduced inertia by the same amount. See "alt" column of "frame" object for details.