cal_node_limit {dendsort} | R Documentation |
Calculate the x coordinates given a branch of dendrogram
Description
cal_node_limit
is a code modified from plotNodeLimit()
to x coordinates of branches given a branch of dendrogram.
Usage
cal_node_limit(x1, x2, subtree, center)
Arguments
x1 |
A x coordinate |
x2 |
Another x coordinate |
subtree |
A dendrogram object. |
center |
A logical whether the dendrogram is centered. |
Value
output A list of parameters.
Examples
#generate sample data
set.seed(1234); par(mar=c(0,0,0,0))
x <- rnorm(10, mean=rep(1:5, each=2), sd=0.4)
y <- rnorm(10, mean=rep(c(1,2), each=5), sd=0.4)
dataFrame <- data.frame(x=x, y=y, row.names=c(1:10))
#calculate Euclidian distance
distxy <- dist(dataFrame)
#hierachical clustering "complete" linkage by default
hc <- hclust(distxy)
total <- cal_total_length(as.dendrogram(hc))
[Package dendsort version 0.3.4 Index]