met.affinity {ANTs}R Documentation

Affinity

Description

Calculates the node metric affinity for all the nodes of the network

Usage

met.affinity(M, df = NULL, dfid = NULL, binary = FALSE)

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.

dfid

an integer or a string indicating the column with individual ids in argument df.

binary

a boolean, if TRUE, it calculates the binary version of the affinity.

Details

Affinity is a second-order metric that evaluates how alters of node i are connected. The binary version is the average degree of alters of node i. The weighted version is the ratio between the metric reach and the strength of node i. A high affinity reveals that nodes tend to be connected to alters with high degrees or strengths. Thus, this metric informs on node assortativity by vertex met.degree, i.e. connections between nodes with similar degrees or strengths.

Value

Author(s)

Sebastian Sosa, Ivan Puga-Gonzalez.

References

Whitehead, H. A. L. (1997). Analysing animal social structure. Animal behaviour, 53(5), 1053-1067.

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

Examples

met.affinity(sim.m)
head(sim.df)
met.affinity(sim.m,df=sim.df)

[Package ANTs version 0.0.16 Index]