| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/unbranch.R |
| 3 |
\name{unbranch} |
| 4 |
\alias{unbranch} |
| 5 |
\alias{unbranch.default} |
| 6 |
\alias{unbranch.dendrogram} |
| 7 |
\alias{unbranch.hclust} |
| 8 |
\alias{unbranch.phylo} |
| 9 |
\title{unbranch trees} |
| 10 |
\usage{ |
| 11 |
unbranch(dend, ...) |
| 12 |
|
| 13 |
\method{unbranch}{default}(dend, ...) |
| 14 |
|
| 15 |
\method{unbranch}{dendrogram}(dend, branch_becoming_root = 1, new_root_height, ...) |
| 16 |
|
| 17 |
\method{unbranch}{hclust}(dend, branch_becoming_root = 1, new_root_height, ...) |
| 18 |
|
| 19 |
\method{unbranch}{phylo}(dend, ...) |
| 20 |
} |
| 21 |
\arguments{ |
| 22 |
\item{dend}{a dendrogram (or hclust) object} |
| 23 |
|
| 24 |
\item{...}{passed on} |
| 25 |
|
| 26 |
\item{branch_becoming_root}{a numeric choosing the branch of the root which will become the new root (from left to right)} |
| 27 |
|
| 28 |
\item{new_root_height}{the new height of the branch which will become the new root. |
| 29 |
If the parameter is not given - the height of the original root is used.} |
| 30 |
} |
| 31 |
\value{ |
| 32 |
An unbranched dendrogram |
| 33 |
} |
| 34 |
\description{ |
| 35 |
unbranch trees and merges the subtree to the parent node. |
| 36 |
} |
| 37 |
\examples{ |
| 38 |
hc <- hclust(dist(USArrests[2:9, ]), "com") |
| 39 |
dend <- as.dendrogram(hc) |
| 40 |
|
| 41 |
par(mfrow = c(1, 3)) |
| 42 |
plot(dend, main = "original tree") |
| 43 |
plot(unbranch(dend, 1), main = "unbranched tree (left branch)") |
| 44 |
plot(unbranch(dend, 2), main = "tree without (right branch)") |
| 45 |
} |
| 46 |
\seealso{ |
| 47 |
\link[ape]{unroot} |
| 48 |
} |