Learn R Programming

dendextend (version 1.18.1)

rotate_DendSer: Rotates dend based on DendSer

Description

Rotates a dendrogram based on its seriation

The function tries to turn the dend into hclust using DendSer.dendrogram (based on DendSer)

Also, if a distance matrix is missing, it will try to use the cophenetic distance.

Usage

rotate_DendSer(dend, ser_weight, ...)

Value

Numeric vector giving an optimal dendrogram order

Arguments

dend

An object of class dendrogram

ser_weight

Used by cost function to evaluate ordering. For cost=costLS, this is a vector of object weights. Otherwise is a dist or symmetric matrix. passed to DendSer.dendrogram and from there to DendSer.

If it is missing, the cophenetic distance is used instead.

...

parameters passed to DendSer

See Also

DendSer, DendSer.dendrogram , untangle_DendSer, rotate_DendSer

Examples

Run this code
if (FALSE) {
library(DendSer) # already used from within the function

dend <- USArrests[1:4, ] %>%
  dist() %>%
  hclust("ave") %>%
  as.dendrogram()
DendSer.dendrogram(dend)

tanglegram(dend, rotate_DendSer(dend))
}

Run the code above in your browser using DataLab