adjust_data | R Documentation |
estimate_shift_configuration
Returns a new tree and new data matrix, where the tree edges are in postorder, and the data row names match the order of the tree tip labels.
adjust_data(tree, Y, normalize = TRUE, quietly = FALSE)
tree |
ultrametric tree of class phylo with branch lengths. |
Y |
trait vector/matrix without missing entries. |
normalize |
logical. If TRUE, normalizes branch lengths to a unit tree height. |
quietly |
logical. If FALSE, changes in tree/trait are printed. |
tree |
tree of class phylo, with the same topology as the input |
Y |
trait vector/matrix with adjusted row names and row order. |
data(lizard.tree, lizard.traits) # here, lizard.traits is a matrix, so columns retain row names: names(lizard.traits[,1]) lizard <- adjust_data(lizard.tree, lizard.traits[,1]) # for a data frame, make sure to retain row names if a single column is selected: lizard.traits <- as.data.frame(lizard.traits) lizard <- adjust_data(lizard.tree, subset(lizard.traits, select=1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.