met.diameter: Diameter

View source: R/met.diameter.R

met.diameterR Documentation

Diameter

Description

Calculates the network diameter .

Usage

met.diameter(
  M,
  df = NULL,
  weighted = TRUE,
  shortest.weight = FALSE,
  normalization = TRUE,
  directed = TRUE,
  out = TRUE
)

Arguments

M

a square adjacency matrix, or a list of square adjacency matrices, or an output of ANT functions stat.ds.grp, stat.df.focal, stat.net.lk.

df

a data frame of same length as the input matrix or a list of data frames if argument M is a list of matrices or an output of ANT functions stat.ds.grp, stat.df.focal, stat.net.lk.

weighted

if FALSE, it binarizes the square adjacency matrix M. Geodesic distances and diameter are based only on the presence or absence of edges.

shortest.weight

if false, it considers the highest met.strength as the shortest path.

normalization

normalizes the weights of the links i.e. divides them by the average strength of the network. Argument normalization can't be TRUE when argument weighted is FALSE.

directed

if false, then it symmetrizes the matrix. Otherwise, it calculates geodesic distances and diameter according to the directionality of the links.

out

if true, it considers outgoing ties.

Details

Diameter is the longer geodesic distance.

Value

  • a double representing the diameter of the network if argument M is a square matrix.

  • A list of doubles if argument M is a list of matrices and if argument df is NULL. Each double represents the diameter of the corresponding matrix of the list.

  • A list of arguments df with a new column of network diameter if argumentdf is not NULL and if argument M is a list of matrices. The name of the column is adapted according to arguments values .weighted, shortest.weight, normalization, directed and out.

  • A list of arguments df with a new column of network diameter if argument df is not NULL, if argument M is an output from ANT functions stat.ds.grp, stat.df.focal, stat.net.lk for multiple matrices permutations, and if argument df is a list of data frames of same length as argument M.

Author(s)

Sebastian Sosa, Ivan Puga-Gonzalez.

References

Opsahl, T., Agneessens, F., & Skvoretz, J. (2010). Node centrality in weighted networks: Generalizing degree and shortest paths. Social networks, 32(3), 245-251.

Sosa, S. (2018). Social Network Analysis, in: Encyclopedia of Animal Cognition and Behavior. Springer.

Examples

met.diameter(sim.m)

SebastianSosa/ant documentation built on Sept. 23, 2023, 7:06 a.m.