pscore {phytools} | R Documentation |
Compute the parsimony score
Description
Calculates the parsimony score using the Fitch algorithm.
Usage
pscore(tree, x, ...)
Arguments
tree |
object of class |
x |
vector (e.g., factor vector), matrix, or data frame. Should contain names or row names. |
... |
optional arguments. |
Details
Mostly for diagnostic purposes. Users interested in using Maximum Parsimony for phylogeny inference or ancestral state reconstruction should refer to the phangorn package.
Value
A numerical value or vector of values.
Author(s)
Liam Revell liam.revell@umb.edu
References
Felsenstein, J. (2004) Inferring Phylogenies. Sinauer.
Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.
See Also
Examples
## load tree and data from Revell & Collar (2009)
data(sunfish.tree)
data(sunfish.data)
## extract discrete character (feeding mode)
fmode<-setNames(sunfish.data$feeding.mode,
rownames(sunfish.data))
## compute the parsimony score
pscore(sunfish.tree,fmode)
[Package phytools version 2.3-0 Index]