Learn R Programming

CausalR (version 1.4.3)

GetShortestPathsFromCCG: get shortest paths from CCG

Description

Gets the node names in the shortest path from one node in a CCG to another

Usage

GetShortestPathsFromCCG(network, hypothesisnode, targetnode, showbothdirs = FALSE, display = TRUE)

Arguments

network
built from iGraph
hypothesisnode
hypothesis node ID
targetnode
target node ID
showbothdirs
where multiple paths from a positive and negative node, FALSE returns only the shortest. Otherwise both are returned.
display
if true, echo the rsulting paths to the screen

Value

a list of vectors containing the nodes of individual paths

Examples

Run this code
network <- system.file(package='CausalR', 'extdata', 'testNetwork.sif')
ccg = CreateCCG(network)
hypothesisnode = 1
targetnode = 10
GetShortestPathsFromCCG (ccg, hypothesisnode, targetnode)

Run the code above in your browser using DataLab