Skip to contents

This function should be used in conjunction with multiple calls to node or node_td to create a DAG object, which can then be used to simulate data using the sim_from_dag and sim_discrete_time functions.

Usage

empty_dag()

Details

Note that this function is only used to initialize an empty DAG object. Actual information about the respective nodes have to be added using the node function or the node_td function. The documentation page of that function contains more information on how to correctly do this.

Value

Returns an empty DAG object.

Author

Robin Denz

Examples

library(simDAG)

# just an empty DAG
empty_dag()
#> An empty DAG object without any nodes.

# adding a node to it
empty_dag() + node("age", type="rnorm", mean=20, sd=5)
#> A DAG object with:
#>   -  1  nodes in total
#>   -  1  of which are root nodes
#>   -  0  of which are child nodes
#>   -  0  of which are time-varying nodes