Description Usage Arguments Details Value Examples
Function to generate uncertainty in branch lengths using a lognormal
1 2 3 4  phylo_generate_uncertainty(phy, size = 100,
uncertainty_method = "other", age_distribution = "uniform",
age_sd = NULL, age_var = 0.1, age_scale = 0, alpha = 0.025,
rescale = TRUE, verbose = FALSE)

phy 
The input tree 
size 
A numeric vector indicating the number of samples to be generated. 
uncertainty_method 
A character vector specifying the method to generate uncertainty. mrbayes is default. 
age_distribution 
A character string specifying the type of calibration. Only "fixed" and "uniform" are implemented for now.

age_sd 
The standard deviation around the age to use for generating the uncertainty. If not a numeric value, var will be used to calculate it. 
age_var 
The variance to calculate age_sd and generate unvcertainty. 
age_scale 
How to scale sd by the depth of the node. If 0, same sd for all. If not, older nodes have more uncertainty 
alpha 
The significance level on uncertainty to generate. By default 0.025 
rescale 
Boolean. If true, observed age will be rescaled each round. 
verbose 
Boolean. If TRUE, it gives printed updates to the user. 
If you want to change the size of sampled trees you do not need to run mrbayes again. Just use sample_trees("mrbayes_trees_file_directory", size = new_size) and you will get a multiPhylo object with a new tree sample.
A phylo or multiPhylo object with the same topology as phy but different branch lengths
1 2 3 4 5 6 7 8 9 10 11 12 13 14  # generate uncertainty over feline species SDM chronogram
# load data
data(felid_sdm)
# by default, generates a sample of 100 trees with var = 0.1
unc < phylo_generate_uncertainty(felid_sdm$phy)
length(unc)
# ltt plot:
max_age < max(sapply(unc, ape::branching.times))
ape::ltt.plot(phy = unc[[1]], xlim = c(max_age, 0), col = "#cce5ff50")
for (i in 2:100){
ape::ltt.lines(phy = unc[[i]], col = "#cce5ff50")
}
ape::ltt.lines(felid_sdm$phy, col = "red")
title(c("fake uncertainty", "in Felidae SDM chronogram"))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.