Learn R Programming

evolqg (version 0.3-4)

PhyloCompare: Compares sister groups

Description

Calculates the comparison of some statistic between sister groups along a phylogeny

Usage

PhyloCompare(tree, node.data, ComparisonFunc = PCAsimilarity, ...)

Value

list with a data.frame of calculated comparisons for each node, using labels or numbers from tree; and a list of comparisons for plotting using phytools (see examples)

Arguments

tree

phylogenetic tree

node.data

list of node data

ComparisonFunc

comparison function, default is PCAsimilarity

...

Additional arguments passed to ComparisonFunc

Author

Diogo Melo

Examples

Run this code
library(ape)
data(bird.orders)
tree <- bird.orders
mat.list <- RandomMatrix(5, length(tree$tip.label))
names(mat.list) <- tree$tip.label
sample.sizes <- runif(length(tree$tip.label), 15, 20)
phylo.state <- PhyloW(tree, mat.list, sample.sizes)

phylo.comparisons <- PhyloCompare(tree, phylo.state)

# plotting results on a phylogeny:
if (FALSE) {
library(phytools)
plotBranchbyTrait(tree, phylo.comparisons[[2]])
}

Run the code above in your browser using DataLab