getPath: Determine the path between two varieties

Description Usage Arguments Examples

Description

Determines the shortest path between the two inputted vertices, and takes into account whether or not the graph is directed. If there is a path, the list of vertices of the path will be returned. If there is not a path, a list of character(0) will be returned. Note: For a directed graph, the direction matters. However, this function will check both directions and return the path if it exists.

Usage

1
getPath(v1, v2, ig, tree, silent = FALSE, isDirected = FALSE)

Arguments

v1

the label of the first variety/vertex of interest (in character string format)

v2

the label of the second variety/vertex of interest (in character string format)

ig

the graph representation of the data tree (in igraph format)

tree

the data tree (in data frame format)

silent

whether or not to print output (defaults to false)

isDirected

whether or not the graph is directed (defaults to false)

Examples

1
2
3
4
data(sbTree)
ig = treeToIG(sbTree)
getPath("Brim","Bedford",ig,sbTree)
getPath("Tokyo","Volstate",ig,sbTree)

dicook/phyViz documentation built on May 15, 2019, 8:24 a.m.