clean.data | R Documentation |
Cleans a table/tree to match with a given table/tree
clean.data(data, tree, inc.nodes = FALSE)
data |
A |
tree |
A |
inc.nodes |
Logical, whether to check if the nodes in |
Note if inc.nodes
is set to TRUE
, the function outputs an error message if there is no matching.
A list
containing the cleaned data and tree(s) and information on the eventual dropped tips and rows.
Thomas Guillerme
tree.age
.
##Creating a set of different trees
trees_list <- list(rtree(5, tip.label = LETTERS[1:5]), rtree(4,
tip.label = LETTERS[1:4]), rtree(6, tip.label = LETTERS[1:6]))
class(trees_list) <- "multiPhylo"
##Creating a matrix
dummy_data <- matrix(c(rnorm(5), runif(5)), 5, 2,
dimnames = list(LETTERS[1:5], c("var1", "var2")))
##Cleaning the trees and the data
cleaned <- clean.data(data = dummy_data, tree = trees_list)
##The taxa that where dropped (tips and rows):
c(cleaned$dropped_tips, cleaned$dropped_rows)
##The cleaned trees:
cleaned$tree
##The cleaned data set:
cleaned$data
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.