extract.parsimonyNumber: Extraction of the actual number of solutions.

View source: R/parsimonyNumber.R

extract.parsimonyNumberR Documentation

Extraction of the actual number of solutions.

Description

extract.parsimonyNumber takes the two matrices computed by parsimonyNumber, and compute the actual number of parsimonious solution for any subtree starting from a given node.

Usage

## S3 method for class 'parsimonyNumber'
extract(
  x,
  node = attr(x$nbrReconstructions, "ntaxa") + 1,
  what = c("number", "cost"),
  ...
)

Arguments

x

an object of class "parsimonyNumber", result of function parsimonyNumber.

node

the root node of the subtree. By default, the root of the tree.

what

the quantity to retrieve. Either "number" for the number of solutions, or "cost" for the minimal cost of a solution. Default to "number".

...

unused

Details

The parsimonious solutions are the one with the minimum number of shifts (that are given by matrix costReconstructions). This function sums the number of solutions (given in matrix nbrReconstructions) that have the minimum number of shifts.

Value

An integer giving the number of equivalent parsimonious solutions.

See Also

parsimonyNumber


pbastide/PhylogeneticEM documentation built on Feb. 12, 2024, 1:27 a.m.