phylomatic_like: A Phylomatic-like Function

View source: R/phylomatic_like.R

phylomatic_likeR Documentation

A Phylomatic-like Function

Description

Subsets a master phylogenetic tree using a provided list of taxon names, similarly to the 'phylomatic' function at https://phylodiversity.net/.

Usage

phylomatic_like(
  tax,
  tree = NULL,
  dataset = "fungi",
  keep_closest = T,
  sep = "_"
)

Arguments

tax

a vector with taxon names to pick from the tree.

tree

optional, a master tree to be subsetted.

dataset

if no 'tree' is provided, select a built-in dataset: 'fungi' (default) or 'plants'

keep_closest

if a species is not found in the master tree, attempts to select a tip from a species in the same genus.

sep

when keep_closest = T, the separator in the taxon names.

Details

Differently to phylomatic, the function allows repeated names as input, which will results in repeated tips with zero-length branches.

As built in datasets, the function currently provides the phylogenetic tree with fungal genera from Tedersoo et al. (2018) Fungal Divers 1-25 (option 'fungi'), and the tree with plant species from Zanne et al. (2014) Nature 506: 89-92.

Value

A phylogenetic tree in ape format.

Examples

x <- c("Agrostis_stolonifer", "Holcus_sp", "Deschampsia_flexuosa", "Calamagrostis_sp")
phylomatic_like(x, dataset = "plants")

jgmv/comecol documentation built on June 6, 2023, 4:07 p.m.