View source: R/Class-hier-fn.R
| numOutEdges | 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 |
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) graph::nodes(g)[is.leaf(g)]
Leaves(bGraph(4, mode = "directed"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.