> dd_sim(c(0.8, 0, 40), 15)Error in while (t[i + 1] <= age) { : missing value where TRUE/FALSE neededIn addition: Warning message: In stats::rexp(1, denom) : NAs produced
When the tree reaches the carrying capacity, variable denom evaluates to 0 (because both lambda and mu are then zero). Sampling an event with rate zero is nonsense, hence the bug.
15
> dd_sim(c(0.8, 0, 40), 15)
Error in while (t[i + 1] <= age) { : missing value where TRUE/FALSE needed
In addition: Warning message: In stats::rexp(1, denom) : NAs produced
When the tree reaches the carrying capacity, variable
denom
evaluates to 0 (because both lambda and mu are then zero). Sampling an event with rate zero is nonsense, hence the bug.