View source: R/tree_generation.R
ConstrainedNJ | R Documentation |
Constructs an approximation to a neighbour-joining tree, modified in order to be consistent with a constraint. Zero-length branches are collapsed at random.
ConstrainedNJ(dataset, constraint, weight = 1L, ratio = TRUE, ambig = "mean")
dataset |
A phylogenetic data matrix of phangorn class |
constraint |
Either an object of class |
weight |
Numeric specifying degree to up-weight characters in
|
ambig , ratio |
Settings of |
ConstrainedNJ()
returns a tree of class phylo
.
Martin R. Smith (martin.smith@durham.ac.uk)
Other tree generation functions:
GenerateTree
,
NJTree()
,
TreeNumber
,
TrivialTree
dataset <- MatrixToPhyDat(matrix(
c(0, 1, 1, 1, 0, 1,
0, 1, 1, 0, 0, 1), ncol = 2,
dimnames = list(letters[1:6], NULL)))
constraint <- MatrixToPhyDat(
c(a = 0, b = 0, c = 0, d = 0, e = 1, f = 1))
plot(ConstrainedNJ(dataset, constraint))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.