assemble_rake: Bind trees as a high-level rake

View source: R/topology.R

assemble_rakeR Documentation

Bind trees as a high-level rake

Description

Takes a multiPhylo object containing multiple trees and combines them into a single tree with a rake structure at its root, below which each tree appears on its own branch.

Usage

assemble_rake(phy)

Arguments

phy

A multiphylo object containing the trees to be combined.

Value

A phylo object, a single tree.

Examples


library(ape)

arnhem_hypothesis <- 
  c("Gunwinyguan", "Mangarrayi-Maran", "Maningrida",
    "Kungarakany", "Gaagudju")
trees <- get_glottolog_trees(arnhem_hypothesis)
simple_rake <- assemble_rake(trees)
rake_in_rake <- assemble_rake(c(assemble_rake(trees[1:3]), trees[4:5]))
plot(simple_rake)
plot(rake_in_rake)

# If `phy` contains only one tree, a warning is issued.
mono_rake <- assemble_rake(trees[3])
plot(mono_rake)

erichround/glottoTrees documentation built on April 17, 2025, 10:47 a.m.