## 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))
Run the code above in your browser using DataLab