mean_distance_wt {brainGraph} | R Documentation |
Calculate weighted shortest path lengths
Description
Calculate graph or vertex average shortest path lengths. For vertices, this is just the row means of the distance matrix. For the graph-level, it is the overall mean of the distance matrix.
Usage
mean_distance_wt(g, level = c("graph", "vertex"), weights = NULL,
xfm = FALSE, xfm.type = NULL, D = NULL)
Arguments
g |
An |
level |
Character string indicating whether to calculate vertex- or
graph-level shortest path length. Default: |
weights |
Numeric vector of edge weights; if |
xfm |
Logical indicating whether to transform the edge weights. Default:
|
xfm.type |
Character string specifying how to transform the weights.
Default: |
D |
Numeric matrix; the graph's “distance matrix” |
Details
By default, edge weights are not transformed (e.g., inverted). However, if
set to TRUE
, then the input graph must have a graph-level attribute
called 'xfm.type'
or you must supply a value in the function call. If
you supply a distance matrix (the D
argument), it is not necessary to
transform edge weights, as it is assumed the the distance matrix was
calculated from a graph with transformed edge weights already.
Value
Numeric vector (if level='vertex'
) of each vertex's shortest
path length, or a single number for the graph-level average