.NonDuplicateRoot | R Documentation |
Identify, for each edge, whether it denotes a different partition from
the root edge.
The first edge of the input tree must be a root edge; this can be
accomplished using Preorder()
.
.NonDuplicateRoot(parent, child, nEdge = length(parent))
parent |
Integer vector corresponding to the first column of the edge
matrix of a tree of class |
child |
Integer vector corresponding to the second column of the edge
matrix of a tree of class |
nEdge |
(optional) integer specifying the number of edges of a tree of
class |
This function is a copy of a deprecated ancestor in TreeTools; see #32.
.NonDuplicateRoot()
returns a logical vector of length nEdge
,
specifying TRUE
unless an edge identifies the same partition as
the root edge.
Martin R. Smith (martin.smith@durham.ac.uk)
tree <- TreeTools::Preorder(TreeTools::BalancedTree(8))
edge <- tree$edge
parent <- edge[, 1]
child <- edge[, 2]
which(!.NonDuplicateRoot(parent, child))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.