swapBL | R Documentation |
The function calculates the effect on PD of swapping terminal or internal branch lengths.
swapBL(
tree = tree,
distribution = distribution,
model = "allswap",
nTimes = 100,
root = TRUE,
index = "PD",
branch = "terminals",
percentual = FALSE,
verbose = TRUE
)
tree |
A single phylogenetic tree with terminal labels, an 'ape' phylo object. |
distribution |
A labeled matrix object, with the distribution of terminal taxa (columns) across areas (rows). |
model |
The type of swap to be performed. Valid values are: * "simpleswap" - Two branch lengths are swapped. * "allswap" (default) - Branch lengths are swapped within the specified branch scope, defined using the 'sample' function. * "uniform" - Branch lengths are replaced by uniformly distributed values between the minimum and maximum values of the original lengths. |
nTimes |
The number of times to repeat the swap. |
root |
Whether to use the root node in PD calculations (default = FALSE). |
branch |
The type of branches to swap: "terminals" (default), "internals", or "all". |
verbose |
Logical indicating whether to print messages during execution (default = TRUE). |
Returns a 'blepd' object containing: * 'initialPD': The PD value of the initial tree. * 'bestInitialArea': The area(s) with the highest PD value in the initial tree. * 'bestModifiedArea': A data frame summarizing the frequency of each area recovered after swaps. * 'tree': The original tree object. * 'distribution': The distribution matrix used for PD calculations. * 'model': The type of swap performed ("simpleswap", "allswap", or "uniform"). * 'nTimes': The number of times the swap was repeated. * 'root': Whether the root was used in PD calculations. * 'index': The PD index used (currently always "PD"). * 'branch': The type of branches swapped ("terminals", "internals", or "all").
Miranda-Esquivel Daniel R.
library(blepd)
data(tree)
data(distribution)
swapBL(tree = tree, distribution = distribution, model = "allswap", nTimes = 100, branch = "terminals")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.