Learn R Programming

keyplayer (version 1.0.1)

mreach.degree: Compute the M-reach Degree Centrality Score in a Netwrok

Description

mreach.degree computes the size of reachable set within M. M-reach degree centrality generalizes the degree centrality by delimiting specific neighborhoods.

Usage

mreach.degree(adj.matrix, node, M = Inf, binary = TRUE, cmode = "all")

Arguments

adj.matrix
Matrix indicating the adjacency matrix of the network.
node
Integer indicating the column index of the chosen player in the adjacenncy matrix. If not specified, scores for all nodes will be reported.
M
Number indicating the maximum geodistance between two nodes, above which the two nodes are considered disconnected. M hence defines the reachable set. The default is Inf.
binary
If TRUE, the adjacency matrix is binarized, and thus M essentially means steps. If FALSE, the edge values are considered.
cmode
String indicating the type of centrality being evaluated. "outdegree", "indegree", and "total" refer to indegree, outdegree, and (total) degree respectively. "all" reports all the above measures and i

Value

  • A vector indicating the outdegree, indegree, or total-degree mreach.degree score of the chosen node; or a data frame containing all the above information.

Details

The interprtation of the measure in binary and weighted adjacency matrix are slightly different, while the function allows both. User can choose to binarize the adjacency matrix, and in this case the reachable set is defined by nodes that are reachable within M steps. Hence those more directly connected to the chosen set form the reachable set. If weighted adjacency matrix is used, the reachable set is defined by nodes that are reachable within geodistance M. Hence those with shorter distance to the chosen set form the reachable set. It is true that the binarized setting is more general as only the network structure matters there and the interpretation of weights is irrelevent. Hence, by default binary=TRUE. See An and Liu (2015) for more details.

References

An, Weihua and Yu-Hsin Liu (2015). "keyplayer: An R Package for Locating Key Players in Social Networks." Working Paper, Indiana Univeristy.

See Also

geodist; mreach.closeness; kpcent; kpset

Examples

Run this code
# Create a 5x5 weighted and directed adjacency matrix,
# where edge values represent the strength of tie
W <- matrix(
  c(0,1,3,0,0,
    0,0,0,4,0,
    1,1,0,2,0,
    0,0,0,0,3,
    0,2,0,0,0),
    nrow=5, ncol=5, byrow = TRUE)


# List the 2-reach degree scores for every node where W is binarized
mreach.degree(W,M=2,cmode="all")

Run the code above in your browser using DataLab