View source: R/treeplyr_functions.R
paint_clades | R Documentation |
This function paints clades on the phylogeny and adds a data column that specifies to which clade each species belongs
paint_clades( tdObject, nclades = 1, name = "clades", interactive = TRUE, type = "nodes", ids = NULL, plot = TRUE )
tdObject |
A |
nclades |
The number of clades that will be specified if used interactively |
name |
The name of the resulting data column |
interactive |
If |
type |
Either "nodes" or "branches" specifying if the ids provided specify the branch id (assuming a
post-ordered tree) or the node number. Ignored if |
ids |
A vector of node numbers of branch numbers that specify clades. Ignored if |
plot |
If |
data(anolis) td <- make.treedata(anolis$phy, anolis$dat) td <- reorder(td, "postorder") td.painted <- paint_clades(td, interactive=FALSE, type="nodes", ids=c(184, 160, 135, 122), plot=TRUE) td.painted <- group_by(td.painted, clades) summarise(td.painted, psig1 = phytools::phylosig(setNames(SVL, phy$tip.label), tree=phy), meanSVL = mean(SVL))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.