Learn R Programming

memnet (version 0.1.0)

aspl: Average shortest path length (aspl)

Description

Computes the average shortest path length (aspl) using igraph's automatic method.

Usage

aspl(adj, types = "uncorrected", weights = NULL, mode = "undirected")

Arguments

adj

numeric matrix representing the adjacency matrix.

types

character. Either "uncorrected" or "corrected", or a vector containing both.

weights

numeric vector of edge weights. Optional.

mode

character, either "directed" or "undirected", specifying whether the network should be interepeted as directed or undirected. Defaults to "undirected".

Value

Local clustering coefficient.

Details

Per default the uncorrected apsl is computed. Otherwise, the uncorrected aspl is normalized by log(n nodes)/log(average degree), i.e., the expected average shortest path length for an Erd<U+00F6>s-Renyi random graph.

Examples

Run this code
# NOT RUN {
# get fluency data
data(animal_fluency)

# edge lists of fluency graphs
edge_list = threshold_graph(animal_fluency)

# get adjacency matrices
adj = edg_to_adj(edge_list)

# get average shortest path length
aspl(adj)

# get corrected average shortest path length
aspl(adj, types = 'corrected')

# }

Run the code above in your browser using DataLab