View source: R/plot.algorithm.R
plot.states.matrix | R Documentation |
Plots an ancestral states reconstruction and tree score
## S3 method for class 'states.matrix'
plot(
x,
passes = 1:4,
show.labels = 0,
col.tips.nodes = c("#fc8d59", "#eeeeeed0", "#7fbf7be0", "#af8dc3e0"),
counts = 0,
use.edge.length = FALSE,
col.states = FALSE,
state.labels = character(0),
legend.pos = "bottomleft",
y.lim = NULL,
cex = 1,
...
)
x |
A |
passes |
|
show.labels |
|
col.tips.nodes |
|
counts |
|
use.edge.length |
|
col.states |
|
state.labels |
vector of mode |
legend.pos |
|
y.lim |
|
cex |
|
... |
any optional arguments to be passed to |
Thomas Guillerme, Martin R. Smith
apply.reconstruction
, runInapp
## A balanced 12 taxa tree
tree <- ape::read.tree(
text = "((((((1,2),3),4),5),6),(7,(8,(9,(10,(11,12))))));")
## A character with inapplicable data
character <- "23--1??--032"
## NA algorithm
NA_matrix <- apply.reconstruction(tree, character, passes = 4, method = "NA")
## Plotting the tree and the states
plot(NA_matrix)
## Plotting the tree and the states with the state changes and regions
plot(NA_matrix, counts = c(1,2))
## Plot the tree with tip/node labels, and only the 1st and 2nd downpass
plot(NA_matrix, passes = c(1,3), show.labels = c(1,2))
## Plot the tree only the 2nd uppass with the state changes in green
plot(NA_matrix, show.labels = 2, col.tips.nodes = c("red", "pink", "green"),
counts = c(1,2), passes = c(3,4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.