N: Subsetting/Indexing 'DAG' Nodes

Description Usage Arguments Value Examples

View source: R/action_node_indexing.R

Description

Subsetting/Indexing DAG Nodes

Usage

1
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

1
2
3
4
5
6
7
8
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"]

osofr/simcausal documentation built on Jan. 6, 2019, 3:05 a.m.