Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

distance_w

Distance in a weighted network


Description

The shortest path length, or geodesic distance, between two nodes in a binary network is the minimum number of steps you need to make to go from one of them to the other. This distance is the quickest connection between nodes when all ties are the same. However, in a weighted network, all ties are not the same. See https://toreopsahl.com/2009/01/09/average-shortest-distance-in-weighted-networks/ for more deatails.

Usage

distance_w(net, directed=NULL, gconly=TRUE, subsample=1, seed=NULL)

Arguments

net

A weighted edgelist

directed

logical, whether the network is directed or undirected. Default is NULL, this means that the function checks whether the edgelist is directed or not.

gconly

logical, whether the function should only be calculated for the giant component. Default is TRUE.

subsample

Whether a only a subset of starting nodes should we used when calculating the measure. This is particularly useful when running out of memory analysing large networks. If it is set to 1, all distances are analysed. If it set to a value below one, this is roughly the proportion of starting noes that will be analysed. If it is set to an interger greater than 1, this number of starting nodes that will be analysed.

seed

If a subset of starting nodes is analysed, by setting this parameter, the results are reproducable.

Value

Returns a distance matrix.

Note

version 1.0.0, taken, with permission, from package tnet

Author(s)

References


bipartite

Visualising Bipartite Networks and Calculating Some (Ecological) Indices

v2.16
GPL
Authors
Carsten F. Dormann, Jochen Fruend and Bernd Gruber, with additional code from Stephen Beckett, Mariano Devoto, Gabriel Felix, Jose Iriondo, Tove Opsahl, Rafael Pinheiro, Rouven Strauss and Diego Vazquez, also based on C-code developed by Nils Bluethgen, Aaron Clauset/Rouven Strauss and Miguel Rodriguez-Girones
Initial release
2021-02-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.