get_cluster_locations: Get coordinates of a cluster (node) on tree

Description Usage Arguments Value Examples

Description

Get coordinates of a cluster (node) on tree

Usage

1
get_cluster_locations(mytree, leaves = FALSE)

Arguments

mytree

a classification tree

leaves

if TRUE, also returns the location of the 2 leaves

Value

a data frames with coordinates of nodes -(xclust,yclust)-, and, if leaves is set to TRUE, coordinates of leaves -(x1,y1), (x2,y2)-

Examples

1
2
3
4
5
6
hc <- hclust(dist(USArrests), "ave")
loc=get_cluster_locations(hc)
plot_tree(hc)
points(loc$xclust[30],loc$yclust[30], col="red")
locsubset=loc[get_lower_clusters(hc,30),]
points(locsubset$xclust,locsubset$yclust, col="blue")

lvaudor/classMapR documentation built on May 7, 2019, 10:54 p.m.