diverse_subtree: Get a diverse subset of species from tree

View source: R/strata.R

diverse_subtreeR Documentation

Get a diverse subset of species from tree

Description

Get a diverse subset of species from tree

Usage

diverse_subtree(tree, n, weights = NULL, collapse = FALSE, FUN = .algo1, ...)

Arguments

tree

phylo object

n

number of species to keep (if greater then the number of species in the tree, the tree is returned unchanged)

weights

Numeric vector with length equal to the number of species in the tree. A weight of 1 will have no influence, lower than one means the species is less likely to be selected.

collapse

Should nodes with a single descendent be collapse?

FUN

The diversification algorithm to use

...

Additional arguments passed to the diversification algorithm function

Value

phylo object

Examples

data(atree)

# default
diverse_subtree(atree, 4)

# do not to include the 't1' species
diverse_subtree(atree, 4, weights=c(t1=0))

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