pscore: Compute the parsimony score

View source: R/parsimony.R

pscoreR Documentation

Compute the parsimony score

Description

Calculates the parsimony score using the Fitch algorithm.

Usage

pscore(tree, x, ...)

Arguments

tree

object of class "phylo".

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

fitMk, sim.Mk

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)

phytools documentation built on June 22, 2024, 10:39 a.m.