###
# set seed
set.seed(1)
# run a birth-death simulation
sim <- bd.sim(n0 = 1, lambda = 0.1, mu = 0.05, tMax = 50)
# choose bins
bins <- seq(0, 50, by = 1)
# generate "true" fossil occurrences
fossils_true <- sample.clade(sim, rho = 1, tMax = 50, returnTrue = TRUE)
# bin the true occurrences
fossils_binned <- bin.occurrences(fossils_true, bins)
# compare
fossils_true
fossils_binned
Run the code above in your browser using DataLab