prune_depth: Prune a tree up to a specified depth.
Description
Prunes a tree up to a depth specified by a set of node names.
Usage
prune_depth(th, names_to_keep)
Value
An object of class TreeHarp.
Arguments
th
A TreeHarp object.
names_to_keep
The node names to keep in the pruned tree.
Details
This is a seldom used function. It works in this way. Given a set
of node names, it identifies the node with the greatest depth in that set.
The function then returns the sub-tree, that contains all the nodes with a
depth smaller than or equal to that depth. If the node types slot is not NA,
then that data frame is filtered and returned too.
Take a look at the examples for a clearer picture.