An R6 class representing an arborescence (a rooted directed tree).
Andrew Sims andrew.sims@newcastle.ac.uk
rdecision::Graph -> rdecision::Digraph -> Arborescence
Inherited methods
rdecision::Graph$degree()rdecision::Graph$edge_along()rdecision::Graph$edge_at()rdecision::Graph$edge_index()rdecision::Graph$graph_adjacency_matrix()rdecision::Graph$has_edge()rdecision::Graph$has_vertex()rdecision::Graph$is_simple()rdecision::Graph$neighbours()rdecision::Graph$order()rdecision::Graph$size()rdecision::Graph$vertex_along()rdecision::Graph$vertex_at()rdecision::Graph$vertex_index()rdecision::Digraph$as_DOT()rdecision::Digraph$digraph_adjacency_matrix()rdecision::Digraph$digraph_incidence_matrix()rdecision::Digraph$direct_predecessors()rdecision::Digraph$direct_successors()rdecision::Digraph$is_acyclic()rdecision::Digraph$is_arborescence()rdecision::Digraph$is_connected()rdecision::Digraph$is_polytree()rdecision::Digraph$is_tree()rdecision::Digraph$is_weakly_connected()rdecision::Digraph$paths()rdecision::Digraph$topological_sort()rdecision::Digraph$walk()
new()Create a new Arborescence object from sets of nodes and edges.
Arborescence$new(V, A)VA list of Nodes.
AA list of Arrows.
An Arborescence object.
is_parent()Test whether the given node is a parent (has child nodes).
Arborescence$is_parent(v)vNode to test
TRUE if v has one or more child nodes, FALSE otherwise.
is_leaf()Test whether the given node is a leaf. In an arborescence,
is_parent() and is_leaf() are mutually exclusive.
Arborescence$is_leaf(v)vVertex to test.
TRUE if v has no child nodes, FALSE otherwise.
root()Find the root vertex of the arborescence.
Arborescence$root()The root vertex.
siblings()Find the siblings of a vertex in the arborescence.
Arborescence$siblings(v)vVertex to test.
A (possibly empty) list of siblings.
root_to_leaf_paths()Find all directed paths from the root of the tree to the leaves.
Arborescence$root_to_leaf_paths()A list of ordered node lists.
postree()Implements function POSITIONTREE (Walker, 1989) to
determine the coordinates for each node in an arborescence.
Arborescence$postree(
SiblingSeparation = 4,
SubtreeSeparation = 4,
LevelSeparation = 1,
RootOrientation = "SOUTH",
MaxDepth = Inf
)SiblingSeparationDistance in arbitrary units for the distance between siblings.
SubtreeSeparationDistance in arbitrary units for the distance between neighbouring subtrees.
LevelSeparationDistance in arbitrary units for the separation between adjacent levels.
RootOrientationMust be one of "NORTH", "SOUTH", "EAST", "WEST". Defined as per Walker (1989), but noting that Walker assumed that y increased down the page. Thus the meaning of NORTH and SOUTH are opposite to his, with the default (SOUTH) having the child nodes at positive y value and root at zero, as per his example (figure 12).
MaxDepthThe maximum depth (number of levels) to be drawn; if the tree exceeds this, an error will be raised.
A data frame with one row per node and three columns (n, x
and y) where n gives the node index given by the
Graph::vertex_index() function.
clone()The objects of this class are cloneable with this method.
Arborescence$clone(deep = FALSE)deepWhether to make a deep clone.
Class to encapsulate a directed rooted tree specialization of a
digraph. An arborescence is a directed tree with exactly one root and
unique directed paths from the root. Inherits from class Digraph.
Walker, John Q II. A A node-positioning algorithm for general trees. University of North Carolina Technical Report TR 89-034, 1989.