order4gema: topological order of a /gema/

View source: R/f05.nbnma.code.r

order4gemaR Documentation

topological order of a /gema/

Description

returns one of the orders of the nodes such as the parents of any node are less ranked than it when is.null(ord). If not check that the proposed order is either a right permutation (is.numeric(ord)) or a vector of node names providing a topological order (is.character(ord)).

Usage

order4gema(gema, ord=NULL)

Arguments

gema

gema object for which the order must be computed.

ord

NULL or an order to test as a permutation or a vector of names.

Details

When !is.null(ord) the order must be an order, if not an error is issued.

Value

a permutation vector of the nodes of the /gema/ or a named list with the nodes not having their parents before them. That is a topological order.

Examples

 names(rbmn0gema.04$mu)[order4gema(rbmn0gema.04)];

rbmn documentation built on July 9, 2023, 6:37 p.m.