File: is.monophyletic.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 (59 lines) | stat: -rw-r--r-- 1,926 bytes parent folder | download | duplicates (8)
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
48
49
50
51
52
53
54
55
56
57
58
59
\name{is.monophyletic}
\alias{is.monophyletic}
\title{
  Is Group Monophyletic
}
\usage{
is.monophyletic(phy, tips, reroot = !is.rooted(phy), plot = FALSE, ...)
}
\description{
    This function tests whether a list of tip labels is monophyletic on a given tree.
}
\arguments{
    \item{phy}{
        a phylogenetic tree description of class \code{"phylo"}.
    }
    \item{tips}{
       a vector of mode numeric or character specifying the tips to be tested.
    }
    \item{reroot}{
       a logical. If \code{FALSE}, then the input tree is not unrooted before the test.
    }
    \item{plot}{
        a logical. If \code{TRUE}, then the tree is plotted with the specified group \code{tips} highlighted.
    }
    \item{\dots}{
       further arguments passed to \code{plot}.
    }
}
\details{
    If \code{phy} is rooted, the test is done on the rooted tree, otherwise
    the tree is first unrooted, then arbitrarily rerooted, in order to be
    independent on the current position of the root. That is, the test
    asks if \code{tips} could be monophyletic given any favourably rooting
    of \code{phy}.

    If \code{phy} is unrooted the test is done on an unrooted tree, unless
    \code{reroot = FALSE} is specified.

    If tip labels in the list \code{tips} are given as characters, they need
    to be spelled as in the object \code{phy}.
}
\value{
    \code{TRUE} or \code{FALSE}.
}
\author{
    Johan Nylander \email{jnylander@users.sourceforge.net}
}
\seealso{
    \code{\link{which.edge}}, \code{\link{drop.tip}}, \code{\link{mrca}}.
}
\examples{
    ## Test one monophyletic and one paraphyletic group on the bird.orders tree
    \dontrun{data("bird.orders")}
    \dontrun{is.monophyletic(phy = bird.orders, tips = c("Ciconiiformes", "Gruiformes"))}
    \dontrun{is.monophyletic(bird.orders, c("Passeriformes", "Ciconiiformes", "Gruiformes"))}
    \dontshow{\dontrun{rm(bird.orders)}}
}
\keyword{utilities}