treedata.table (version 0.1.0)

tdt: 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.

Value

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

Details

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

Examples

Run this code
# NOT RUN {
data(anolis)
# }
# NOT RUN {
# 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
))
# }

Run the code above in your browser using DataCamp Workspace