Description Usage Arguments Details Value Author(s) References Examples

View source: R/average.distance.R

This function return average distance of a node in a strongly connected and loop free graph.

1 2 | ```
averagedis(graph, vids = V(graph), mode = c("all", "out", "in"),
weights = NULL)
``` |

`graph` |
The input graph as igraph object |

`vids` |
Vertex sequence, the vertices for which the centrality values are returned. Default is all vertices. |

`mode` |
Character constant, gives whether the shortest paths to or from the given vertices should be calculated for directed graphs. If out then the shortest paths from the vertex, if in then to it will be considered. If all, the default, then the corresponding undirected graph will be used, ie. not directed paths are searched. This argument is ignored for undirected graphs. |

`weights` |
Possibly a numeric vector giving edge weights. If this is NULL, the default, and the graph has a weight edge attribute, then the attribute is used. If this is NA then no weights are used (even if the graph has a weight attribute). |

Average distance of node *u* to the rest of nodes in the net defined as:

*C(u)=sum(dis(u,w)/(n-1), w in V)*

It is invers of closeness centrality.

More detail at Average Distance

A numeric vector contaning the centrality scores for the selected vertices.

Mahdi Jalili [email protected]

del Rio, Gabriel, Dirk Koschutzki, and Gerardo Coello. "How to identify essential genes from molecular networks?." BMC systems biology 3.1 (2009): 102.

1 2 | ```
g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE)
averagedis(g)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.