bin_par_rec {nichevol}R Documentation

Maximum parsimony reconstruction of ancestral character states

Description

Maximum parsimony reconstruction of ancestral character states

Usage

bin_par_rec(tree_data, ...)

Arguments

tree_data

a list of two elements (phy and data) resulting from using the function treedata.

...

other arguments from asr_max_parsimony. Arguments tree and tip_states are fixed.

Details

Reconstructions are done using the asr_max_parsimony function from the castor package.

Value

A table with columns representing bins, rows representing first tip states and then reconstructed nodes.

Examples

# a simple tree
data("tree5", package = "nichevol")

# a matrix of niche charactes (1 = present, 0 = absent, ? = unknown)
dataTable <- cbind("241" = rep("1", length(tree5$tip.label)),
                   "242" = rep("1", length(tree5$tip.label)),
                   "243" = c("1", "1", "0", "0", "0"),
                   "244" = c("1", "1", "0", "0", "0"),
                   "245" = c("1", "?", "0", "0", "0"))
rownames(dataTable) <- tree5$tip.label

# list with two objects (tree and character table)
treeWdata <- geiger::treedata(tree5, dataTable)

# Maximum parsimony reconstruction
par_rec <- bin_par_rec(treeWdata)

[Package nichevol version 0.1.20 Index]