phytools: Phylogenetic Tools for Comparative Biology (and Other Things)


> library(phytools)

Attaching package: 'phytools'

The following object is masked from 'package:Matrix':


バージョン: 0.4.60

関数名 概略
add.arrow Add an arrow pointing to a tip or node on the tree Add color bar to a plot
add.everywhere Add tip to all edges in a tree
add.random Add tips at random to the tree
add.simmap.legend Add legend to stochastically mapped tree Add species to genus on a phylogeny
allFurcTrees Generate all bi- and multifurcating unrooted trees
anc.Bayes Bayesian ancestral character estimation
anc.ML Ancestral character estimation using likelihood
anc.trend Ancestral character estimation with a trend
ancThresh Ancestral character estimation under the threshold model using Bayesian MCMC
`anoletree Phylogeny of Greater Antillean anole ecomorph species with mapped discrete character
applyBranchLengths Applies the branch lengths of a reference tree to a target
ave.rates Average the posterior rates
bind.tip Attaches a new tip to a tree
bmPlot Simulates and visualizes discrete-time Brownian evolution on a phylogeny
branching.diffusion Animation of branching random diffusion
brownie.lite Likelihood test for rate variation in a continuous trait
brownieREML REML version of brownie.lite
cladelabels Add labels to subtrees of a plotted phylogeny Collapse a subtree to a star phylogeny
collapseTree Interactive tree visualizer
contMap Map continuous trait evolution on the tree
countSimmap Counts the number of character changes on a
SIMMAP style tree or set of trees
densityMap Plot posterior density of stochastic mapping on a tree
describe.simmap Summarizes a stochastic mapped tree or set of trees
di2multi.simmap Collapse branches of zero length to polytomy in stochastic map style tree
drop.clade Drop a clade from a tree
drop.leaves Drop all the leaves (tips) from a tree
drop.tip.contMap Drop tip or tips from an object of class "contMap" or "densityMap"
drop.tip.simmap Drop tips or extract clade from tree with mapped discrete character
estDiversity Estimate diversity at each node of the tree
evol.rate.mcmc Bayesian MCMC method for identifying
exceptional phenotypic diversification in a phylogeny
evol.vcv Likelihood test for variation in the evolutionary VCV matrix
evolvcv.lite Likelihood test for a shift in the evolutionary correlation between traits
exhaustiveMP Exhaustive and branch & bound MP optimization
expm Matrix exponential Export trees & data in XML format
fancyTree Plots special types of phylogenetic trees
fastAnc Fast estimation of ML ancestral states
fastBM Fast Brownian simulation
fastMRCA Get the MRCA (or height above the root of the MRCA) of a pair of tip taxa
findMRCA Get the MRCA of a set of taxa
fitBayes Evolutionary model fitting with intraspecific variability using Bayesian MCMC
fitDiversityModel Fit diversity-dependent phenotypic evolution model
fitPagel Function to test for correlated evolution of binary traits
gammatest Gamma test of Pybus & Harvey (2000)
genSeq Simulate a DNA alignment on the tree under a model
getCladesofSize Get all subtrees larger than or equal to a specified size
getDescendants Get descendant node numbers
getExtant Returns a list of the extant or extinct lineages in a tree containing non-contemporaneous tips
getSisters Get the sister node number, label, or set of nodes for a node or tip
getStates Get the states at nodes or tips from a mapped tree
ladderize.simmap Ladderize a tree with a mapped discrete character
lambda.transform Lambda transformation of matrix
likMlambda Likelihood for joint lambda
locate.fossil Locate a fossil lineage in a tree using continuous characters
locate.yeti Locate a cryptic, recently extinct, or missing taxon on a tree
ls.tree Least squares branch lengths for a given tree
ltt Creates lineage-through-time plot (including extinct lineages)
ltt95 Creates a (1-alpha)-percent CI for a set of LTTs Create "era" map on a phylogenetic tree
make.simmap Simulate stochastic character maps on a phylogenetic tree or trees
map.overlap Proportional overlap between two mapped character histories on a tree Converts a mapped tree to a tree with singleton nodes
matchNodes Matches nodes between two trees
mergeMappedStates Merge two or more mapped states into one state
midpoint.root Midpoint root a phylogeny
minRotate Rotates all nodes of the tree to minimize the difference in order with a vector
minSplit Finding the minimum (median) split in the posterior sample
mrp.supertree Matrix representation parsimony supertree estimation
multi.mantel Multiple matrix regression (partial Mantel test)
multiC Returns a list with phylogenetic VCV matrix for each mapped state
multiRF Computes Robinson-Foulds distance between a set of trees
nodeHeights Compute the heights above the root of each node Phylogeny inference using the least squares method
orderMappedEdge Order the columns of mapped.edge to match across trees
paintSubTree Paint sub-trees with a discrete character
paste.tree Paste two trees together
pbtree Simulate pure-birth or birth-death stochastic tree or trees
pgls.Ives Phylogenetic regression with intraspecific sampling error
phenogram Plot phenogram (traitgram)
phyl.RMA Phylogenetic reduced major axis (RMA) regression
phyl.cca Phylogenetic canonical correlation analysis
phyl.pairedttest Phylogenetic paired t-test
phyl.pca Phylogenetic principal components analysis
phyl.resid Phylogenetic size-correction via GLS regression
phyl.vcv Compute evolutionary VCV matrix for a tree & dataset
phylANOVA Phylogenetic ANOVA and post-hoc tests Plot tree with tips linked to geographic coordinates
phylo.toBackbone Converts tree to backbone or vice versa
phyloDesign Compute design matrix for least squares analyses
phylomorphospace Creates phylomorphospace plot
phylomorphospace3d Creates tree-dimensional phylomorphospace plot
phylosig Compute phylogenetic signal with two methods
phytools-package phytools: Phylogenetic Tools for comparative biology (and other things)
plot.backbonePhylo Plots backbone tree with triangles as clades
plotBranchbyTrait Plot branch colors by a quantitative trait or value
plotSimmap Plot stochastic character mapped tree
plotThresh Tree plotting with posterior probabilities of ancestral states from the threshold model
plotTree Plots rooted phylogenetic tree
plotTree.wBars Plot a tree with bars at the tips
posterior.evolrate Analysis of the posterior sample from evol.rate.mcmc
print.backbonePhylo Print method for backbone phylogeny
ratebystate Method for investigating the rate of one trait as a function of the state of another
rateshift Find the temporal position of one or more rate shifts
read.newick Robust Newick style tree reader
read.simmap Read SIMMAP style trees from file
reorder.backbonePhylo Reorders a backbone phylogeny
reorderSimmap Reorder edges of a simmap tree
rep.phylo Replicate a tree or set of trees
reroot Re-root a tree along an edge
rerootingMethod Get marginal ancestral state reconstructions by re-rooting
rescaleSimmap Rescale SIMMAP style tree
rotateNodes Rotates a node or set of nodes in a phylogenetic tree
roundBranches Rounds the branch lengths of a tree
roundPhylogram Plot a round phylogram
rstate Pick a random state according to a vector of probabilities
sampleFrom Sample from a set of distributions
setMap Set color map for objects of class '"contMap"' or '"densityMap"'
sim.corrs Multivariate Brownian simulation with multiple correlations and rates
sim.history Simulate stochastic character history under some model
sim.ratebystate Conduct simulation of state dependent rate variation
sim.rates Brownian simulation with multiple evolutionary rates
skewers Matrix comparison using the method of random skewers
splitTree Split tree at a point
splitplotTree Plots a phylogeny in two columns
starTree Create star phylogeny
strahlerNumber Computes Strahler number for trees and nodes
threshBayes Threshold model using Bayesian MCMC
threshDIC Deviance Information Criterion from the threshold model
threshState Computes value for a threshold character from a liability and thresholds
to.matrix Convert a character vector to a binary matrix
treeSlice Slices the tree at a particular point and returns all subtrees
untangle Attempts to untangle crossing branches for plotting
vcvPhylo Calculates cophenetic (i.e., phylogenetic VCV) matrix
write.simmap Write a stochastic character mapped tree to file
writeAncestors Write a tree to file with ancestral states and (optionally) CIs at nodes
writeNexus Write a tree to file in Nexus format



  • tree
  • vcv
  • anc
  • internal








  • Pagel... 0は系統シグナルなし。1が完全な系統シグナルを検出
  • Blomberg... 0は系統シグナルなし。1に近くなれば系統シグナルを検出

$H_0$: 系統シグナルを検出しない(ランダムサンプリングした種群の形質値と比較)


  • tree
  • x
  • method: K or lambda
  • test
  • nsim
  • se
  • start
  • control
> tree <- pbtree(n = 100)
> x <- fastBM(tree)
> phylosig(tree, x, method = "lambda", test = TRUE)
[1] 1.012029

[1] -146.5145

[1] -198.9946

[1] 1.246044e-24