Description Usage Arguments Value Examples
Select graph edges randomly, or according to probabilities, which can depend on 2 criterias: centrality index (betweenness, sum of extremities degree, etc) and/or spatial distance. These are used only of their weight > 0. By default, spatial distance is ignored, with an exponent of 0.
1 2 3 4 5 6 7 8 9 10 |
g |
An igraph object. |
n |
numeric; number of edges returned (default: 1). |
es |
igraph.es; edges sequence among which to choose (default: all edges). |
mode |
character; either 'random' or 'targeted'. Method used to choose
the |
ct.ind.FUN |
function used to compute centrality index of the edge sequence.
Used only if ci.w > 0. Default is |
ct.ind.w |
numeric; exponent weighting edge centrality index in probabilities. If negative, less central edges are more likely to be chosen (default: 1). |
sp.dist.attr |
character; name of the edge attribute containing spatial distance (default: 'dist'). |
sp.dist.w |
numeric; exponent weighting spatial distance in probabilities. If negative, shortest-distance edges are more likely to be chosen (default: 0). |
An igraph.es edge(s) sequence of length n
.
1 2 3 4 5 6 7 8 9 | library(igraph)
g = erdos.renyi.game(100, 120, 'gnm')
## Get a random edge
getEdges(g)
## Get the highest betweenness edge
getEdges(g, mode="targeted")
# Get 2 edges with high betweenness and low spatial distance
E(g)$dist = runif(length(E(g)))
getEdges(g, n=2, mode="proba", ct.ind.w=2, sp.dist.w=-3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.