mean_distance_wt | R Documentation |
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.
mean_distance_wt(g, level = c("graph", "vertex"), weights = NULL,
xfm = FALSE, xfm.type = NULL, D = NULL)
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” |
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.
Numeric vector (if level='vertex'
) of each vertex's shortest
path length, or a single number for the graph-level average
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.