File: is.binary.tree.Rd

package info (click to toggle)
r-cran-ape 5.8-1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,676 kB
  • sloc: ansic: 7,676; cpp: 116; sh: 17; makefile: 2
file content (47 lines) | stat: -rw-r--r-- 1,366 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
\name{is.binary}
\alias{is.binary}
\alias{is.binary.phylo}
\alias{is.binary.multiPhylo}
\alias{is.binary.tree}
\title{Test for Binary Tree}
\description{
  This function tests whether a phylogenetic tree is binary.
}
\usage{
is.binary(phy)
\method{is.binary}{phylo}(phy)
\method{is.binary}{multiPhylo}(phy)
\method{is.binary}{tree}(phy)
}
\arguments{
  \item{phy}{an object of class \code{"phylo"} or \code{"multiPhylo"}.}
}
\details{
  The test differs whether the tree is rooted or not. An urooted tree is
  considered binary if all its nodes are of degree three (i.e., three
  edges connect to each node). A rooted tree is considered binary if all
  nodes (including the root node) have exactly two descendant nodes, so
  that they are of degree three expect the root which is of degree 2.

  The test ignores branch lengths. Consider using \code{\link{di2multi}}
  if you want to treat zero-branch lengths as resulting from
  multichotomies.
  
  \code{is.binary.tree} is deprecated and will be removed soon:
  currently it calls \code{is.binary}.
}
\value{
  a logical vector.
}
\seealso{
\code{\link{is.rooted}}, \code{\link{is.ultrametric}}, \code{\link{multi2di}}
}
\author{Emmanuel Paradis}
\examples{
is.binary(rtree(10))
is.binary(rtree(10, rooted = FALSE))
is.binary(stree(10))
x <- setNames(rmtree(10, 10), LETTERS[1:10])
is.binary(x)
}
\keyword{logic}