clade_membership: Designate clade membership for each tip for downstream...

View source: R/ST&P_Rates.R

clade_membershipR Documentation

Designate clade membership for each tip for downstream analyses summarizing rates for each clade

Description

Designate clade membership for each tip for downstream analyses summarizing rates for each clade

Usage

clade_membership(tree, ancestral_nodes, other_nodes_label = "other_nodes")

Arguments

tree

Tree object (file path to a Nexus file) used to extract node numbers and tip labels.

ancestral_nodes

A named list specifying the MRCA node number for each clade. The names are the clade labels. To specify non-monophyletic groups, use a character string in the format "inclusive_node - exclusive_node".

other_nodes_label

A label to assign to tips not included in any clade defined by ancestral_nodes.

Value

A data frame with columns: node (node number), ancestral_node (source MRCA node), and clade (clade label). Each row represents the clade assignment of a node in the tree.

Examples

## Not run: 
ancestral_nodes <- list(
  Non_lepidosauria = 242,
  Other_Lepidosauria = 237,
  Gekkota = 222,
  Scincoidea = 210,
  Teiioidea = 192,
  Lacertidae = 209,
  Amphisbaenia = 205,
  Anguiformes = 150,
  Acrodonta = 145,
  Pleurodonta = 133,
  Caenophidia = 170,
  Early_Serpentes = "164 - 170"  # non-monophyletic group
)

Nodes_Clade_Table <- clade_membership(
  tree = "tree.nex",
  ancestral_nodes = ancestral_nodes,
  other_nodes_label = "deep_Squamata_nodes"
)

## End(Not run)


EvoPhylo documentation built on Aug. 27, 2025, 5:11 p.m.