Description Usage Arguments Value Examples
Minimize diet gaps in an adjacency matrix based on prey phylogeny using steepest descent optimization
1 | minimize.phylo.gaps.sd(adj, phy, verbose = FALSE)
|
adj |
an adjacency matrix of class 'matrix' |
phy |
a phylogenetic tree of class 'phylo' |
verbose |
a logical indicating whether or not the function should print out details of the status of the optimization process |
The function returns a list made up of four elements ('adj', 'phy.init', 'phy.optim', and 'gaps.optim'). 'adj' and 'phy.init' are the adjacency matrix and phylogenetic tree, respectively, that were passed to the function. 'phy.optim' is the rotated phylogeny that corresponds to the minimum number of gaps found, and 'gaps.optim' is the value of that minimum.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data(eklof)
gaps.phylo <- minimize.phylo.gaps.sd(eklof$network, eklof$tree)
## Not run:
# Load the sample data
data(eklof)
# Run 1000 optimizations
gaps.phylo <- lapply(1:1000, function(x)(minimize.phylo.gaps.sd(eklof$network, eklof$tree)))
Find the minimum from this sample
gaps.phylo <- gaps.phylo[[which.min(lapply(gaps.phylo,function(x)x$gaps.optim))]]
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.