Learn R Programming

PathwaySpace (version 1.0.1)

pathDistances: Calculate a pathway space distance between two vectors.

Description

Calculate a pathway space distance between two vectors.

Usage

pathDistances(gdist, from, to, nperm = 1000, verbose = TRUE)

Value

A list with pathway space distances and a 'ggplot' object.

Arguments

gdist

A distance matrix computed by the igraph's distances function. Rows and columns must be named with vertex labels as listed in the 'igraph' object.

from

A vector with valid vertex names.

to

A vector with valid vertex names.

nperm

Number of permutations.

verbose

A single logical value specifying to display detailed messages (when verbose=TRUE) or not (when verbose=FALSE).

See Also

plotPathwaySpace

Examples

Run this code

# Load a vertex-wise distance matrix (distance between nodes in a graph)
data("gdist.toy", package = "PathwaySpace")

# Get two vertex lists
from <- sample(colnames(gdist.toy), 50)
to <- sample(colnames(gdist.toy), 50)

# Calculate distances between lists, and between random lists
res <- pathDistances(gdist.toy, from, to)
names(res)
# "p_dist"  "z_score"

Run the code above in your browser using DataLab