as.phylo.dendrogram: Convert a dendrogram into phylo

View source: R/ape.R

as.phylo.dendrogramR Documentation

Convert a dendrogram into phylo

Description

Based on as.hclust.dendrogram with as.phylo.hclust

In the future I hope a more direct link will be made.

Usage

as.phylo.dendrogram(x, ...)

Arguments

x

a dendrogram

...

ignored.

Value

A phylo class object

See Also

as.dendrogram, as.hclust, as.phylo

Examples

## Not run: 

library(dendextend)
library(ape)
dend <- iris[1:30, -5] %>%
  dist() %>%
  hclust() %>%
  as.dendrogram()
dend2 <- as.phylo(dend)
plot(dend2, type = "fan")

library(dendextend)
library(ggplot2)
# no longer needed: library(ggdendro)
dend <- iris[1:30, -5] %>%
   dist() %>%
   hclust() %>%
   as.dendrogram()
# there is a bug in the location of the labels 
# If you want to solve it - please send a Pull Request to:
# https://github.com/talgalili/dendextend/
ggplot(dend) +
   scale_y_reverse(expand = c(0.2, 0)) + coord_polar(start = 1, theta="x") 
   

## End(Not run)


# see: https://github.com/klutometis/roxygen/issues/796
#

dendextend documentation built on Oct. 13, 2024, 1:06 a.m.