MoTBFs (version 1.2)

getChildParentsFromGraph: Get Relationships in a Network

Description

Extract the relationship between the variables of a dataset using the obtained network

Usage

getChildParentsFromGraph(graph, nameVars = NULL)

Arguments

graph

A structural network of the class "graphNEL", "network" or "bn".

nameVars

A character array giving the names of the variables in the graph. By default it's NULL, only put it when a graph of class "network" is used.

Value

A list of elements. Each element contains a vector with the name of a child and their parents.

Examples

Run this code
# NOT RUN {
## Data
data(ecoli)
ecoli <- ecoli[,-1] ## Sequence Name

## DAG1
dag1 <- LearningHC(ecoli)
dag1
plot(dag1)
getChildParentsFromGraph(dag1)

## DAG2
dag2 <- LearningHC(ecoli, numIntervals = 10)
dag2
plot(dag2)
getChildParentsFromGraph(dag2)

# }

Run the code above in your browser using DataLab