]> git.donarmstrong.com Git - ape.git/blob - man/is.monophyletic.Rd
various bug fixes
[ape.git] / man / is.monophyletic.Rd
1 \name{is.monophyletic}
2 \alias{is.monophyletic}
3 \title{
4   Is Group Monophyletic
5 }
6 \usage{
7 is.monophyletic(phy, tips, reroot = !is.rooted(phy), plot = FALSE, ...)
8 }
9 \description{
10     This function tests whether a list of tip labels is monophyletic on a given tree.
11 }
12 \arguments{
13     \item{phy}{
14         a phylogenetic tree description of class \code{"phylo"}.
15     }
16     \item{tips}{
17        a vector of mode numeric or character specifying the tips to be tested.
18     }
19     \item{reroot}{
20        a logical. If \code{FALSE}, then the input tree is not unrooted before the test.
21     }
22     \item{plot}{
23         a logical. If \code{TRUE}, then the tree is plotted with the specified group \code{tips} highlighted.
24     }
25     \item{\dots}{
26        further arguments passed to \code{plot}.
27     }
28 }
29 \details{
30     If \code{phy} is rooted, the test is done on the rooted tree, otherwise
31     the tree is first unrooted, then arbitrarily rerooted, in order to be
32     independent on the current position of the root. That is, the test
33     asks if \code{tips} could be monophyletic given any favourably rooting
34     of \code{phy}.
35
36     If \code{phy} is unrooted the test is done on an unrooted tree, unless
37     \code{reroot = FALSE} is specified.
38
39     If tip labels in the list \code{tips} are given as characters, they need
40     to be spelled as in the object \code{phy}.
41 }
42 \value{
43     \code{TRUE} or \code{FALSE}.
44 }
45 \author{
46     Johan Nylander \email{jnylander@users.sourceforge.net}
47 }
48 \seealso{
49     \code{\link{which.edge}}, \code{\link{drop.tip}}, \code{\link{mrca}}.
50 }
51 \examples{
52     ## Test one monophyletic and one paraphyletic group on the bird.orders tree
53     \dontrun{data("bird.orders")}
54     \dontrun{is.monophyletic(phy = bird.orders, tips = c("Ciconiiformes", "Gruiformes"))}
55     \dontrun{is.monophyletic(bird.orders, c("Passeriformes", "Ciconiiformes", "Gruiformes"))}
56     \dontshow{\dontrun{rm(bird.orders)}}
57 }
58 \keyword{utilities}
59