BM | R Documentation |
Calculates phylogenetic weights according the to BranchManager method of Stone & Sidow (2007).
BM(phy)
phy |
A phylo object |
Adapted from original R code by Eric A. Stone, published as supplementary material to Stone & Sidow (2007).
A vector of weights
library(ape)
# Three trees, representing three genealogical hypotheses, that relate
# languages A,B,C,D:
tree1 <- read.tree(text = "(((A:1,B:1,C:1):1,D:2):0.3);")
plot(tree1)
tree2 <- read.tree(text = "(((A:0.2,B:0.2,C:0.2):1.8,D:2):0.3);")
plot(tree2)
tree3 <- read.tree(text = "(((A:1.8,B:1.8,C:1.8):0.2,D:2):0.3);")
plot(tree2)
# The BM weights of each language in each tree:
BM(tree1)
BM(tree2)
BM(tree3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.