bin_par_rec | R Documentation |
Maximum parsimony reconstruction of ancestral character states
bin_par_rec(tree_data, ...)
tree_data |
a list of two elements (phy and data) resulting from using
the function |
... |
other arguments from |
Reconstructions are done using the asr_max_parsimony
function from the castor
package.
A table with columns representing bins, rows representing first tip states and then reconstructed nodes.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.