subtree: Select a subset of nodes from a tree

View source: R/tree_manipulation.R

subtreeR Documentation

Select a subset of nodes from a tree

Description

Select a subset of nodes from a tree

Usage

subtree(x, id, ...)

## S3 method for class 'Strata'
subtree(x, id, type = "name", ...)

## S3 method for class 'phylo'
subtree(x, id, collapse = TRUE, descend = TRUE, type = "auto", ...)

Arguments

x

phylo object

id

vector of ids or names

...

Arguments sent to subtree.phylo

type

id type: ['name', 'index', 'auto']

collapse

logical collapse edges around nodes with a single descendent

descend

logical include all descendents of each id

Value

phylo object

Examples

data(atree)
subtree(atree, c('n15', 'n19'))
subtree(atree, c('t7', 't4', 't1'))

arendsee/phylostratr documentation built on Dec. 31, 2022, 10:22 a.m.