adj.get.hops: Function to identify all children of a parent

Description Usage Arguments Details Value Author(s) Examples

Description

This function uses a depth-first search algorithm to identify all the children (and their corresponding depth) of a node.

Usage

1
adj.get.hops(adjmat)

Arguments

adjmat

adjacency matrix; parents in rows, children in columns

Details

The algorithm is based on the depth-first search.

Value

two-column matrix containing the names of the children in the first column and their corresponding depth in the descent in the second column

Author(s)

Benjamin Haibe-Kains

Examples

1
2
3
4
## check whether a list of two nodes are children of another node
set.seed(54321)
mytopo <- matrix(sample(0:1, 100, replace=TRUE, prob=c(0.7,0.3)), nrow=10, dimnames=list(LETTERS[1:10], LETTERS[1:10]))
adj.get.hops(adjmat=mytopo)

predictionet documentation built on Nov. 8, 2020, 7:48 p.m.