smooth_rec: Smooth character table values resulted from ancestral...

View source: R/smooth_rec.R

smooth_recR Documentation

Smooth character table values resulted from ancestral character state reconstructions

Description

Smooth character table values resulted from ancestral character state reconstructions

Usage

smooth_rec(whole_rec_table)

Arguments

whole_rec_table

matrix containing all reconstructed characters for all tips and nodes. It results from using the functions bin_par_rec or bin_ml_rec.

Value

The matrix of reconstructed characters with smoothed values.

Examples

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

# simple matrix of data
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
treeWdata <- geiger::treedata(tree5, dataTable)

# ancestral reconstruction
parsimonyReconstruction <- bin_par_rec(treeWdata)

# smoothing reconstructions
smooth_rec(parsimonyReconstruction)

nichevol documentation built on March 31, 2023, 5:38 p.m.