PlotCharacter {TreeSearch} | R Documentation |
Plot the distribution of a character on a tree
Description
Reconstructs the distribution of a character on a tree topology using the modified Fitch algorithm presented in Brazeau et al. (2019).
Usage
PlotCharacter(
tree,
dataset,
char = 1L,
updateTips = FALSE,
plot = TRUE,
tokenCol = NULL,
ambigCol = "grey",
inappCol = "lightgrey",
ambigLty = "dotted",
inappLty = "dashed",
plainLty = par("lty"),
tipOffset = 1,
unitEdge = FALSE,
...
)
Arguments
tree |
A tree of class |
dataset |
A phylogenetic data matrix of phangorn class
|
char |
Index of character to plot. |
updateTips |
Logical; if |
plot |
Logical specifying whether to plot the output. |
tokenCol |
Palette specifying colours to associate with each token in
turn, in the sequence listed in |
ambigCol , ambigLty , inappCol , inappLty , plainLty |
Colours and line types
to apply to ambiguous, inapplicable and applicable tokens. See the |
tipOffset |
Numeric: how much to offset tips from their labels. |
unitEdge |
Logical: Should all edges be plotted with a unit length? |
... |
Further arguments to pass to |
Value
PlotCharacter()
invisibly returns a matrix in which each row
corresponds to a numbered tip or node of tree
, and each column corresponds
to a token; the tokens that might parsimoniously be present at each point
on a tree are denoted with TRUE
.
Author(s)
Martin R. Smith (martin.smith@durham.ac.uk)
References
Brazeau MD, Guillerme T, Smith MR (2019). “An algorithm for morphological phylogenetic analysis with inapplicable data.” Systematic Biology, 68(4), 619–631. doi:10.1093/sysbio/syy083.
Examples
# Set up plotting area
oPar <- par(mar = rep(0, 4))
tree <- ape::read.tree(text =
"((((((a, b), c), d), e), f), (g, (h, (i, (j, (k, l))))));")
## A character with inapplicable data
dataset <- TreeTools::StringToPhyDat("23--1??--032", tips = tree)
plotted <- PlotCharacter(tree, dataset)
plotted
# Character from a real dataset
data("Lobo", package = "TreeTools")
dataset <- Lobo.phy
tree <- TreeTools::NJTree(dataset)
PlotCharacter(tree, dataset, 14)
par(oPar)