Learn R Programming

⚠️There's a newer version (2.4-4) of this package.Take me there.

phytools (version 0.6-60)

Phylogenetic Tools for Comparative Biology (and Other Things)

Description

A wide range of functions for phylogenetic analysis. Functionality is concentrated in phylogenetic comparative biology, but also includes a diverse array of methods for visualizing, manipulating, reading or writing, and even inferring phylogenetic trees and data. Included among the functions in phylogenetic comparative biology are various for ancestral state reconstruction, model-fitting, simulation of phylogenies and data, and multivariate analysis. There are a broad range of plotting methods for phylogenies and comparative data which include, but are not restricted to, methods for mapping trait evolution on trees, for projecting trees into phenotypic space or a geographic map, and for visualizing correlated speciation between trees. Finally, there are a number of functions for reading, writing, analyzing, inferring, simulating, and manipulating phylogenetic trees and comparative data not covered by other packages. For instance, there are functions for randomly or non-randomly attaching species or clades to a phylogeny, for estimating supertrees or consensus phylogenies from a set, for simulating trees and phylogenetic data under a range of models, and for a wide variety of other manipulations and analyses that phylogenetic biologists might find useful in their research.

Copy Link

Version

Install

install.packages('phytools')

Monthly Downloads

8,304

Version

0.6-60

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Liam Revell

Last Published

September 28th, 2018

Functions in phytools (0.6-60)

bd

Convert object of class "birthdeath" to raw birth & death rates
aic.w

Computes AIC weights
evol.rate.mcmc

Bayesian MCMC method for identifying exceptional phenotypic diversification in a phylogeny
bind.tree.simmap

Attaches a new tip to a tree
bmPlot

Simulates and visualizes discrete-time Brownian evolution on a phylogeny
fastAnc

(Reasonably) fast estimation of ML ancestral states
getCladesofSize

Get all subtrees larger than or equal to a specified size
fastBM

(Reasonably) fast quantitative trait simulation on phylogenies
estDiversity

Estimate diversity at each node of the tree
applyBranchLengths

Applies the branch lengths of a reference tree to a target
anc.ML

Ancestral character estimation using likelihood
bind.tip

Attaches a new tip to a tree
anc.trend

Ancestral character estimation with a trend
getDescendants

Get descendant node numbers
cladelabels

Add labels to subtrees of a plotted phylogeny
brownieREML

REML version of brownie.lite
branching.diffusion

Animation of branching random diffusion
densityMap

Plot posterior density of stochastic mapping on a tree
brownie.lite

Likelihood test for rate variation in a continuous trait
densityTree

Plots a posterior sample of trees
paste.tree

Paste two trees together
pbtree

Simulate pure-birth or birth-death stochastic tree or trees
as.multiPhylo

Conversion to object of class "multiPhylo"
ancThresh

Ancestral character estimation under the threshold model using Bayesian MCMC
phyloDesign

Compute design matrix for least squares analyses
anoletree

Phylogeny of Greater Antillean anole ecomorph species with mapped discrete character
ave.rates

Average the posterior rates
contMap

Map continuous trait evolution on the tree
drop.tip.simmap

Drop tips or extract clade from tree with mapped discrete character
phylomorphospace

Creates phylomorphospace plot
edgeProbs

Compute the relative frequencies of state changes along edges
compare.chronograms

Compares to chronograms with precisely matching nodes in a visual manner
force.ultrametric

Forces a phylogenetic tree to be ultrametric
fitPagel

Function to test for correlated evolution of binary traits
averageTree

Compute an average tree from a set of trees and related operations
collapse.to.star

Collapse a subtree to a star phylogeny
consensus.edges

Compute consensus edges for a tree under some criterion
cophylo

Creates a co-phylogenetic plot
collapseTree

Interactive tree visualizer
describe.simmap

Summarizes a stochastic mapped tree or set of trees
dotTree

Creates a phylogenetic dot plot
di2multi.simmap

Collapse branches of zero length to polytomy in stochastic map style tree
export.as.xml

Export trees & data in XML format
drop.clade

Drop a clade from a tree
phytools-package

phytools: Phylogenetic Tools for comparative biology (and other things)
ctt

Generates (or simulates) a 'changes through time' plot from a set of stochastic map character histories
getStates

Get the states at nodes or tips from a mapped tree
cospeciation

Conducts a statistical test of cospeciation between two trees
fit.bd

Fits birth-death (speciation/extinction) model to reconstructed phylogeny
fitBayes

Evolutionary model fitting with intraspecific variability using Bayesian MCMC
locate.fossil

Locate a fossil lineage in a tree using continuous characters
fancyTree

Plots special types of phylogenetic trees
locate.yeti

Locate a cryptic, recently extinct, or missing taxon on a tree
map.to.singleton

Converts a mapped tree to a tree with singleton nodes
countSimmap

Counts the number of character changes on a SIMMAP style tree or set of trees
density.multiSimmap

Computes a posterior distribution for the number and types of changes on the 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"
fastMRCA

Get the MRCA (or height above the root of the MRCA) of a pair of tip taxa
labelnodes

Function to interactively label nodes of a plotted tree
fitDiversityModel

Fit diversity-dependent phenotypic evolution model
ltt95

Creates a (1-\(\alpha\))-percent CI for a set of LTTs
make.era.map

Create "era" map on a phylogenetic tree
modified.Grafen

Computes modified Grafen edge lengths
mapped.states

Returns a vector, matrix, or list of the mapped states on a tree or set of trees
mrp.supertree

Matrix representation parsimony supertree estimation
plot.backbonePhylo

Plots backbone tree with triangles as clades
evol.vcv

Likelihood test for variation in the evolutionary VCV matrix
multiC

Returns a list with phylogenetic VCV matrix for each mapped state
multi.mantel

Multiple matrix regression (partial Mantel test)
evolvcv.lite

Likelihood test for a shift in the evolutionary correlation between traits
phyl.pairedttest

Phylogenetic paired t-test
pgls.Ives

Phylogenetic regression with intraspecific sampling error
exhaustiveMP

Exhaustive and branch & bound MP optimization
expand.clade

Expands (or contracts) the tip-spacing of a given clade or clades
plotTree.wBars

Plot a tree with bars at the tips
phenogram

Plot phenogram (traitgram)
gammatest

Gamma test of Pybus & Harvey (2000)
fitMk

Fits Mk model
findMRCA

Get the MRCA of a set of taxa
phylo.to.map

Plot tree with tips linked to geographic coordinates
getExtant

Returns a list of the extant or extinct lineages in a tree containing non-contemporaneous tips
genSeq

Simulate a DNA alignment on the tree under a model
geo.legend

Adds a geological (or other temporal) legend to a plotted tree
ladderize.simmap

Ladderize a tree with a mapped discrete character
lambda.transform

Lambda transformation of matrix
get.treepos

Internal functions
getSisters

Get the sister node number, label, or set of nodes for a node or tip
phylo.toBackbone

Converts tree to backbone or vice versa
posterior.evolrate

Analysis of the posterior sample from evol.rate.mcmc
linklabels

Function to add tip labels to a plotted tree with linking lines
rateshift

Find the temporal position of one or more rate shifts
likMlambda

Likelihood for joint lambda
phyl.pca

Phylogenetic principal components analysis
ls.tree

Least squares branch lengths for a given tree
ltt

Creates lineage-through-time plot (including extinct lineages)
plotTree.datamatrix

Plot a tree with a discrete character data matrix at the tips
read.newick

Robust Newick style tree reader
roundPhylogram

Plot a round phylogram
minRotate

Rotates all nodes of the tree to minimize the difference in order with a vector
markChanges

Add marked changes to a plotted tree with mapped discrete character
reroot

Re-root a tree along an edge
plotTree.errorbars

Plot a tree with error bars around divergence dates
make.simmap

Simulate stochastic character maps on a phylogenetic tree or trees
minSplit

Finding the minimum (median) split in the posterior sample
skewers

Matrix comparison using the method of random skewers
map.overlap

Proportional overlap between two mapped character histories on a tree
splitEdgeColor

Split edge colors when descendant edges have different mapped states
matchNodes

Matches nodes between two trees
rerootingMethod

Get marginal ancestral state reconstructions by re-rooting
treeSlice

Slices the tree at a particular point and returns all subtrees, or the tree rootward of the point
mergeMappedStates

Merge two or more mapped states into one state
midpoint.root

Midpoint root a phylogeny
untangle

Attempts to untangle crossing branches for plotting
rstate

Pick a random state according to a vector of probabilities
nodelabels.cophylo

Add labels to a plotted "cophylo" object
sim.corrs

Multivariate Brownian simulation with multiple correlations and rates
splitTree

Split tree at a point
optim.phylo.ls

Phylogeny inference using the least squares method
multiRF

Computes Robinson-Foulds distance between a set of trees
nodeHeights

Compute the heights above the root of each node
phyl.RMA

Phylogenetic reduced major axis (RMA) regression
phylANOVA

Phylogenetic ANOVA and post-hoc tests
phylo.heatmap

Creates a phylogenetic heat map
splitplotTree

Plots a phylogeny in two columns
threshBayes

Threshold model using Bayesian MCMC
sim.history

Simulate character history or a discrete character at the tips of the tree under some model
orderMappedEdge

Order the columns of mapped.edge to match across trees
threshState

Computes value for a threshold character from a liability and thresholds
to.matrix

Convert a character vector to a binary matrix
paintSubTree

Paint sub-trees with a discrete character
plotThresh

Tree plotting with posterior probabilities of ancestral states from the threshold model
phyl.resid

Phylogenetic size-correction via GLS regression
threshDIC

Deviance Information Criterion from the threshold model
phyl.vcv

Compute evolutionary VCV matrix for a tree & dataset
writeAncestors

Write a tree to file with ancestral states and (optionally) CIs at nodes
plotTree

Plots rooted phylogenetic tree
read.simmap

Read SIMMAP style trees from file
phyl.cca

Phylogenetic canonical correlation analysis
plotBranchbyTrait

Plot branch colors by a quantitative trait or value
phylomorphospace3d

Creates tree-dimensional phylomorphospace plot
writeNexus

Write a tree to file in Nexus format
plotSimmap

Plot stochastic character mapped tree
reorder.backbonePhylo

Reorders a backbone phylogeny
phylosig

Compute phylogenetic signal with two methods
rotateNodes

Rotates a node or set of nodes in a phylogenetic tree
posthoc

Generic post-hoc test
ratebystate

Method for investigating the rate of one trait as a function of the state of another
print.backbonePhylo

Print method for backbone phylogeny
roundBranches

Rounds the branch lengths of a tree
ratebytree

Likelihood test for rate variation among trees
sim.ratebystate

Conduct simulation of state dependent rate variation
reorderSimmap

Reorder edges of a simmap tree
resolveNode

Compute all possible resolutions of a node or all nodes in a multifurcating tree
sim.rates

Brownian or OU simulation with multiple evolutionary regimes
rescaleSimmap

Rescale SIMMAP style tree
vcvPhylo

Calculates cophenetic (i.e., phylogenetic VCV) matrix
write.simmap

Write a stochastic character mapped tree to file
rep.phylo

Replicate a tree or set of trees
sampleFrom

Sample from a set of distributions
setMap

Set color map for objects of class "contMap" or "densityMap"
starTree

Create star phylogeny
strahlerNumber

Computes Strahler number for trees and nodes
add.simmap.legend

Add legend to stochastically mapped tree
anc.Bayes

Bayesian ancestral character estimation
add.arrow

Add an arrow pointing to a tip or node on the tree
add.everywhere

Add tip to all edges in a tree
add.random

Add tips at random to the tree
Dtest

Conducts correlational D-test from stochastic mapping
add.species.to.genus

Add species to genus on a phylogeny or bind simulated species subtrees to a backbone genus tree
add.color.bar

Add color bar to a plot
allFurcTrees

Generate all bi- and multifurcating unrooted trees