% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/KeptPaths.R
\name{KeptPaths}
\alias{KeptPaths}
\alias{KeptPaths.data.frame}
\alias{KeptPaths.matrix}
\title{Paths present in reduced tree}
\usage{
KeptPaths(paths, keptVerts, all = TRUE)

\method{KeptPaths}{data.frame}(paths, keptVerts, all = TRUE)

\method{KeptPaths}{matrix}(paths, keptVerts, all = TRUE)
}
\arguments{
\item{paths}{\code{data.frame} of paths in master tree, perhaps generated using
\code{\link[=PathLengths]{PathLengths()}}.}

\item{keptVerts}{Logical specifying whether each entry is retained in the
reduced tree, perhaps generated using \code{\link[=KeptVerts]{KeptVerts()}}.}

\item{all}{Logical: if \code{TRUE}, return all paths that occur in the reduced
tree; if \code{FALSE}, return only those paths that correspond to a single edge.
that correspond to edges in the reduced tree.
Ignored if \code{paths} is a matrix.}
}
\value{
\code{KeptPaths()} returns a logical vector specifying whether each path
in \code{paths} occurs when \code{keptVerts} vertices are retained.
}
\description{
Lists which paths present in a master tree are present when leaves are
dropped.
}
\examples{
master <- BalancedTree(9)
paths <- PathLengths(master)
keptTips <- c(1, 5, 7, 9)
keptVerts <- KeptVerts(master, keptTips)
KeptPaths(paths, keptVerts)
paths[KeptPaths(paths, keptVerts, all = FALSE), ]
}
\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[=KeptVerts]{KeptVerts()}},
\code{\link[=LeafLabelInterchange]{LeafLabelInterchange()}},
\code{\link[=MakeTreeBinary]{MakeTreeBinary()}},
\code{\link[=Renumber]{Renumber()}},
\code{\link[=RenumberTips]{RenumberTips()}},
\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}
