Run a function on a treedata.table
object
tdt(tdObject, ...)
tdObject | A treedata.table object |
---|---|
... | A function call. |
Function output for a single tree (phylo) or a list of function outputs (one per each tree in the MultiPhylo object)
This function allows R functions that use trees and data to be run
ontreedata.table
objects.
data(anolis) # \donttest{ # A treedata.table object with a phylo $phy td <- as.treedata.table(anolis$phy, anolis$dat)#>#>#>#>#> GEIGER-fitted comparative model of continuous data #> fitted ‘BM’ model parameters: #> sigsq = 0.136160 #> z0 = 4.065918 #> #> model summary: #> log-likelihood = -4.700404 #> AIC = 13.400807 #> AICc = 13.524519 #> free parameters = 2 #> #> Convergence diagnostics: #> optimization iterations = 100 #> failed iterations = 0 #> number of iterations with same best fit = 100 #> frequency of best fit = 1.00 #> #> object summary: #> 'lik' -- likelihood function #> 'bnd' -- bounds for likelihood search #> 'res' -- optimization iteration summary #> 'opt' -- maximum likelihood parameter estimates# A treedata.table object with a multiPhylo $phy treesFM <- list(anolis$phy, anolis$phy) class(treesFM) <- "multiPhylo" td <- as.treedata.table(treesFM, anolis$dat)#>#>#>#>#> [[1]] #> GEIGER-fitted comparative model of continuous data #> fitted ‘BM’ model parameters: #> sigsq = 0.136160 #> z0 = 4.065918 #> #> model summary: #> log-likelihood = -4.700404 #> AIC = 13.400807 #> AICc = 13.524519 #> free parameters = 2 #> #> Convergence diagnostics: #> optimization iterations = 100 #> failed iterations = 0 #> number of iterations with same best fit = 100 #> frequency of best fit = 1.00 #> #> object summary: #> 'lik' -- likelihood function #> 'bnd' -- bounds for likelihood search #> 'res' -- optimization iteration summary #> 'opt' -- maximum likelihood parameter estimates #> #> [[2]] #> GEIGER-fitted comparative model of continuous data #> fitted ‘BM’ model parameters: #> sigsq = 0.136160 #> z0 = 4.065918 #> #> model summary: #> log-likelihood = -4.700404 #> AIC = 13.400807 #> AICc = 13.524519 #> free parameters = 2 #> #> Convergence diagnostics: #> optimization iterations = 100 #> failed iterations = 0 #> number of iterations with same best fit = 100 #> frequency of best fit = 1.00 #> #> object summary: #> 'lik' -- likelihood function #> 'bnd' -- bounds for likelihood search #> 'res' -- optimization iteration summary #> 'opt' -- maximum likelihood parameter estimates #># }