`treeheight` <-
function(tree)
{
if (inherits(tree, "spantree"))
return(sum(tree$dist))
tree <- as.hclust(tree)
sum(tree$height) + max(tree$height)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.