Learn R Programming

TreeSearch (version 1.1.0)

IWScore: Calculate the parsimony score of a tree given a dataset

Description

TreeLength() uses the Morphy library Brazeau2017TreeSearch to calculate a parsimony score for a tree, handling inapplicable data according to the algorithm of Brazeau2019;textualTreeSearch. Trees may be scored using equal weights, implied weights Goloboff1993TreeSearch, or profile parsimony Faith2001TreeSearch.

Usage

IWScore(tree, dataset, concavity = 10L, ...)

TreeLength(tree, dataset, concavity = Inf)

# S3 method for phylo TreeLength(tree, dataset, concavity = Inf)

# S3 method for numeric TreeLength(tree, dataset, concavity = Inf)

# S3 method for list TreeLength(tree, dataset, concavity = Inf)

# S3 method for multiPhylo TreeLength(tree, dataset, concavity = Inf)

Fitch(tree, dataset)

Arguments

tree

A tree of class phylo, a list thereof (optionally of class multiPhylo), or an integer -- in which case tree random trees will be uniformly sampled.

dataset

A phylogenetic data matrix of class phyDat, whose names correspond to the labels of any accompanying tree.

concavity

Determines the degree to which extra steps beyond the first are penalized. Specify a numeric value to use implied weighting Goloboff1993TreeSearch; concavity specifies k in k / e + k. A value of 10 is recommended; TNT sets a default of 3, but this is too low in some circumstances Goloboff2018,Smith2019TreeSearch. Better still explore the sensitivity of results under a range of concavity values, e.g. k = 2 ^ (1:7). Specify Inf to weight each additional step equally. Specify 'profile' to employ profile parsimony Faith2001TreeSearch.

unused; allows additional parameters specified within … to be received by the function without throwing an error.

Value

TreeLength() returns a numeric vector containing the score for each tree in tree.

References

See Also

Other tree scoring: CharacterLength(), MinimumLength(), MorphyTreeLength()

Examples

Run this code
# NOT RUN {
data("inapplicable.datasets")
tree <- TreeTools::BalancedTree(inapplicable.phyData[[1]])
TreeLength(tree, inapplicable.phyData[[1]])
TreeLength(tree, inapplicable.phyData[[1]], concavity = 10)
TreeLength(tree, inapplicable.phyData[[1]], concavity = 'profile')
TreeLength(5, inapplicable.phyData[[1]])
# }

Run the code above in your browser using DataLab