find_all_paths: Find all paths in a causal model

View source: R/utils.R

find_all_pathsR Documentation

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)

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

Value

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

Examples

 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")


causaloptim documentation built on Oct. 17, 2024, 9:08 a.m.