simcausal (version 0.2.0)

N: Subsetting/Indexing DAG Nodes

Description

Subsetting/Indexing DAG Nodes

Usage

N(DAG)

Arguments

DAG
A DAG object that was defined using functions node and set.DAG.

Value

  • returns a list of nodes that can be indexed as a typical named list "[[]]".

Examples

Run this code
D <- DAG.empty()
D <- D + node(name="W1", distr="rbern", prob=plogis(-0.5))
D <- D + node(name="W2", distr="rbern", prob=plogis(-0.5 + 0.5*W1))
D <- set.DAG(D)
#Returns all nodes from DAG D
N(D)
#Returns node W1 from DAG D
N(D)["W1"]

Run the code above in your browser using DataCamp Workspace