% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tree_numbering.R
\name{RenumberTips}
\alias{RenumberTips}
\alias{RenumberTips.phylo}
\alias{RenumberTips.Splits}
\alias{RenumberTips.multiPhylo}
\alias{RenumberTips.list}
\alias{RenumberTips.NULL}
\title{Renumber a tree's tips}
\usage{
RenumberTips(tree, tipOrder)

\method{RenumberTips}{phylo}(tree, tipOrder)

\method{RenumberTips}{Splits}(tree, tipOrder)

\method{RenumberTips}{multiPhylo}(tree, tipOrder)

\method{RenumberTips}{list}(tree, tipOrder)

\method{RenumberTips}{`NULL`}(tree, tipOrder)
}
\arguments{
\item{tree}{A tree of class \code{\link[ape:read.tree]{phylo}}.}

\item{tipOrder}{A character vector containing the values of
\code{tree[["tip.label"]]} in the desired sort order,
an object (perhaps of class \code{phylo} or \code{Splits}) with tip labels,
or a numeric specifying the desired order.}
}
\value{
\code{RenumberTips()} returns \code{tree}, with the tips' internal
representation numbered to match \code{tipOrder}.
}
\description{
\code{RenumberTips(tree, tipOrder)} sorts the tips of a phylogenetic tree \code{tree}
such that the indices in \code{tree[["edge"]][, 2]} correspond to the order of
leaves given in \code{tipOrder}.
}
\examples{
data("Lobo") # Loads the phyDat object Lobo.phy
tree <- RandomTree(Lobo.phy)
tree <- RenumberTips(tree, names(Lobo.phy))

}
\seealso{
Other tree manipulation:
\code{\link[=AddTip]{AddTip()}},
\code{\link[=CollapseNode]{CollapseNode()}},
\code{\link[=ConsensusWithout]{ConsensusWithout()}},
\code{\link[=DropTip]{DropTip()}},
\code{\link[=ImposeConstraint]{ImposeConstraint()}},
\code{\link[=KeptPaths]{KeptPaths()}},
\code{\link[=KeptVerts]{KeptVerts()}},
\code{\link[=LeafLabelInterchange]{LeafLabelInterchange()}},
\code{\link[=MakeTreeBinary]{MakeTreeBinary()}},
\code{\link[=Renumber]{Renumber()}},
\code{\link[=RenumberTree]{RenumberTree()}},
\code{\link[=RootTree]{RootTree()}},
\code{\link[=SortTree]{SortTree()}},
\code{\link[=Subtree]{Subtree()}},
\code{\link[=TipTimedTree]{TipTimedTree()}},
\code{\link{TrivialTree}}
}
\author{
\href{https://orcid.org/0000-0001-5660-1727}{Martin R. Smith}
(\href{mailto:martin.smith@durham.ac.uk}{martin.smith@durham.ac.uk})
}
\concept{tree manipulation}
