data.tree (version 0.7.11)

Distance: Find the distance between two nodes of the same tree

Description

The distance is measured as the number of edges that need to be traversed to reach node2 when starting from node1.

Usage

Distance(node1, node2)

Arguments

node1

the first node in the tree

node2

the second node in the same tree

Examples

Run this code
# NOT RUN {
data(acme)
Distance(FindNode(acme, "Outsource"), FindNode(acme, "Research"))

# }

Run the code above in your browser using DataCamp Workspace