drop.things | R Documentation |
Remove fossils or living species or non-bifurcating nodes (singles) from treats
objects or phylo
objects.
drop.things(treats, what)
drop.fossils(treats)
drop.livings(treats)
drop.singles(treats)
treats |
|
what |
what to drop. Can be |
NOTE that dropping living or fossils species DOES NOT drop associated internal nodes and edge lengths. To drop both fossil/living taxa AND internal nodes, you can use for example: drop.things(drop.things(my_data, what = "fossils"), what = "singles")
.
This function outputs either a "phylo"
object if no traits where generated or a treats
object that is a list of at least two elements: $tree
, a "phylo"
object and $data
, a "matrix"
of the trait values.
Thomas Guillerme
treats
plot.treats
## A random tree with fossils and traits and internal nodes every 0.5 times
set.seed(3)
my_data <- treats(stop.rule = list(max.taxa = 20),
bd.params = list(speciation = 1, extinction = 1/3),
traits = make.traits(), save.steps = 0.5)
## A tree with 20 tips and 54 nodes
my_data$tree
## And a dataset with 74 rows
dim(my_data$data)
## Removing the fossil species
drop.things(my_data, what = "fossils")$tree
dim(drop.fossils(my_data)$data)
## Removing the living species
drop.things(my_data, what = "livings")$tree
dim(drop.livings(my_data)$data)
## Removing the internal nodes
drop.things(my_data, what = "singles")$tree
dim(drop.singles(my_data)$data)
## Removing the internal nodes AND the fossils
drop.singles(drop.fossils(my_data))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.