# Generating a test dataset
set.seed(1371)
x <- raphylo(20)
# Extracting the tree and annotations
tree <- x$tree
anno <- with(x, rbind(tip.annotation, node.annotation))
anno <- data.frame(id = with(tree, c(tip.label, node.label)), anno)
types <- data.frame(id = tree$node.label, x$node.type)
# Creating a aphylo tree without node types
aphylo_from_data_frame(tree, anno)
# Now including types
aphylo_from_data_frame(tree, anno, types)
# Dropping some data
aphylo_from_data_frame(tree, anno[sample.int(nrow(anno), 10),])
Run the code above in your browser using DataLab