Coordinates of the Dendrogram

dend_xy(dend)

Arguments

dend

a dendrogram object.

Details

dend will be processed by adjust_dend_by_x if it is processed yet.

Value

A list of leave positions (x) and dendrogram height (y).

Examples

m = matrix(rnorm(100), 10) dend1 = as.dendrogram(hclust(dist(m))) dend_xy(dend1)
#> $x #> [1] 0.5 1.5 2.5 3.5 4.5 5.5 6.5 7.5 8.5 9.5 #> #> $y #> [1] 0.000000 6.953111 #>
dend1 = adjust_dend_by_x(dend1, sort(runif(10))) dend_xy(dend1)
#> $x #> [1] 0.1604751 0.3029049 0.3295474 0.3882047 0.5636447 0.6262569 0.8625519 #> [8] 0.8911143 0.9531012 0.9966172 #> #> $y #> [1] 0.000000 6.953111 #>
dend1 = adjust_dend_by_x(dend1, unit(1:10, "cm")) dend_xy(dend1)
#> $x #> [1] 1cm 2cm 3cm 4cm 5cm 6cm 7cm 8cm 9cm 10cm #> #> $y #> [1] 0.000000 6.953111 #>