Learn R Programming

causaloptim (version 1.0.0)

find_all_paths: Find all paths in a causal model

Description

Given a set of response functions, find all directed paths from from to to

Usage

find_all_paths(respvars, from, to)

Value

A list with all the paths or a list with NULL if there are none

Arguments

respvars

A set of response functions as created by create_response_function

from

A character string indicating the start of the path

to

A character string indicating the end of the path

Examples

Run this code
 b <- initialize_graph(igraph::graph_from_literal(X -+ Z, Z -+ Y, X -+ Y, Ur -+ Z, Ur -+ Y))
 medmod <- create_response_function(b)
 find_all_paths(medmod, "X", "Y")
 igraph::all_simple_paths(b, "X", "Y", mode = "out")

Run the code above in your browser using DataLab