tdt: Run a function on a 'treedata.table' object

View source: R/tdt.R

tdtR Documentation

Run a function on a treedata.table object

Description

Run a function on a treedata.table object

Usage

tdt(tdObject, ...)

Arguments

tdObject

A treedata.table object

...

A function call.

Details

This function allows R functions that use trees and data to be run ontreedata.table objects.

Value

Function output for a single tree (phylo) or a list of function outputs (one per each tree in the MultiPhylo object)

Examples

data(anolis)


# A treedata.table object with a phylo $phy
td <- as.treedata.table(anolis$phy, anolis$dat)
tdt(td, geiger::fitContinuous(phy, extractVector(td, "SVL"),
  model = "BM", ncores = 1
))


# A treedata.table object with a multiPhylo $phy
treesFM <- list(anolis$phy, anolis$phy)
class(treesFM) <- "multiPhylo"
td <- as.treedata.table(treesFM, anolis$dat)
tdt(td, geiger::fitContinuous(phy, extractVector(td, "SVL"),
  model = "BM",
  ncores = 1
))


treedata.table documentation built on Nov. 6, 2025, 1:14 a.m.