reposition: Reset dendrogram height attributes.

Description Usage Arguments Value Author(s) Examples

View source: R/utils.R

Description

reposition is a helper function used for manually creating "dendrogram" objects from nested lists. The function recursively reassigns the 'height' attributes at each node by a given constant.

Usage

1
reposition(x, shift = "reset")

Arguments

x

an object of class "dendrogram".

shift

either the character string "reset" (shift the graph so that the height of the farthest leaf from the root is zero), or a numeric value giving the amount to shift the graph along the primary axis.

Value

Returns an object of class "dendrogram".

Author(s)

Shaun Wilkinson

Examples

1
2
3
4
  x <- read.dendrogram(text = "(A:0.1,B:0.2,(C:0.3,D:0.4):0.5);")
  plot(x, horiz = TRUE)
  x <- reposition(x)
  plot(x, horiz = TRUE)

phylogram documentation built on May 2, 2019, 3:46 p.m.