get_spp_nodes: Species and their respective ancestral nodes

View source: R/function_spp_nodes.R

get_spp_nodesR Documentation

Species and their respective ancestral nodes

Description

This function computes a matrix containing species and their respective ancestral nodes

Usage

get_spp_nodes(tree, node.prefix = "N")

Arguments

tree

Phylogenetic tree

node.prefix

Character indicating the prefix to be used to name nodes, default is the letter "N"

Details

This is an auxiliary function that, by taking a phylogenetic tree, allows to represent in a matrix format the relationship between present-day species (tips) and their ancestors (nodes). The function provides an easy way to obtain certain objects that can be used in other functions, like calc_ancestral_state

Value

A matrix with species in lines and nodes in columns. 1 indicates that the node corresponds to the ancestor of that species and zero indicates that species does not share the ancestor node

Examples

data(akodon_newick)
get_spp_nodes(tree = akodon_newick, node.prefix = "N")


GabrielNakamura/Rrodotus documentation built on Aug. 31, 2023, 2:13 p.m.