if (requireNamespace("ape")) {
library(ape)
tr <- rtree(10)
plot(tr)
# Drop tips containing "t1" or "t2" in their label
tr2 <- drop_tips_update(tr, pattern = "t1|t2")
plot(tr2)
# Alternatively, specify tips directly
tr3 <- drop_tips_update(tr, drop_name = c("t3", "t5"))
plot(tr3)
}
Run the code above in your browser using DataLab