View source: R/bin.occurrences.R
bin.occurrences | R Documentation |
Given the output of sample.clade(..., returnTrue = FALSE)
, returns
the occurrence counts in each bin (i.e., the same as
sample.clade(..., returnTrue = TRUE)
). This helps to trace
perfect parallels between both output formats of sample.clade
.
bin.occurrences(fossils, bins)
fossils |
A |
bins |
A vector of time intervals corresponding to geological time ranges. |
This function helps a user bin "true occurrences" directly into
binned occurrences, allowing for comparisons among "perfectly known"
fossil records and records that have a certain resolution (given by the
bins
parameter).
A data.frame
exactly as returned by
sample.clade(..., returnTrue = TRUE)
. See ?sample.clade)
for
details.
Matheus Januario.
###
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.