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

Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.

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 Nov. 10, 2023, 1:08 a.m.