knitr::opts_chunk$set(dev = "png", fig.height = 7, fig.width = 7, dpi = 300, out.width = "600px",
                      fig.align = 'center')

Easy phylogenetic path analysis in R

Use the phylopath package for an easy to use framework to perform phylogenetic path analysis (PPA).

PPA can be used to compare support for competing causal models of trait evolution, while taking shared ancestry into account. All you need is: 1. A clear set of models to test. 2. A data set of species with trait values. 3. A phylogeny of your species.

For a complete worked example, click "Get Started" above, or see the PeerJ paper.

This method was developed by Von Hardenberg and Gonzalez-Voyer. See citation() for info on correct citations.

library(phylopath)

models <- define_model_set(
  one   = c(LS ~ BM, NL ~ BM, DD ~ NL, RS ~ DD),
  two   = c(LS ~ BM, NL ~ BM, DD ~ NL, RS ~ LS + DD),
  three = c(LS ~ BM, NL ~ BM, DD ~ NL, RS ~ NL),
  four  = c(LS ~ BM, NL ~ BM, DD ~ NL, RS ~ BM + NL),
  five  = c(LS ~ BM, NL ~ BM, DD ~ NL, RS ~ BM + NL + DD),
  six   = c(LS ~ BM, NL ~ BM + RS, DD ~ NL, RS ~ BM),
  seven = c(LS ~ BM, NL ~ BM + RS, DD ~ NL, RS ~ LS + BM),
  eight = c(LS ~ BM, NL ~ BM + RS, DD ~ NL),
  nine  = c(LS ~ BM, NL ~ BM + RS, DD ~ NL, RS ~ LS)
)

plot_model_set(models, rotation = -57, flip_x = TRUE)
result <- phylo_path(models, data = rhino, tree = rhino_tree, 
                     order = c('BM', 'NL', 'DD', 'LS', 'RS'))
#plot(choice(result, 'five'), rotation = 9.45, curvature = -0.0000001, flip_x = TRUE)
plot(choice(result, 'five'), rotation = 10, curvature = -0.05, flip_x = TRUE)

phylopath has been used by >100 publications so far!



Ax3man/phylopath documentation built on April 5, 2024, 4:54 p.m.