numOutEdges {classGraph} | R Documentation |
In a directed or undirected graph, for each node count the number of edges “leaving” that nodes.
numOutEdges(g)
g |
an R object of class graph
(from package graph). |
an integer
vector the same length as
nodes(g)
giving the number of edges that ``go
out'' from each node.
Martin Maechler
edgeL
on which this function is built, and
leaves
, both from package graph.
## Simplistic leaves() definition for *directed graphs* : ## { compare with graph::leaves() } is.leaf <- function(g) numOutEdges(g) == 0 ## (also exists hiddenly..) Leaves <- function(g) nodes(g)[is.leaf(g)] Leaves(bGraph(4, mode = "directed"))