Learn R Programming

HEMDAG (version 2.7.4)

distances.from.leaves: Distances from leaves

Description

Compute the minimum distance of each node from one of the leaves of the graph.

Usage

distances.from.leaves(g)

Arguments

g

a graph of class graphNEL. It represents the hierarchy of the classes.

Value

A named vector. The names are the names of the nodes of the graph g, and their values represent the distance from the leaves. A value equal to 0 is assigned to the leaves, 1 to nodes with distance 1 from a leaf and so on.

Examples

Run this code
# NOT RUN {
data(graph);
dist.leaves <- distances.from.leaves(g);
# }

Run the code above in your browser using DataLab