get_centrality_scores: Returns the centrality values of nodes in a graph using given...

View source: R/graph_util.R

get_centrality_scoresR Documentation

Returns the centrality values of nodes in a graph using given method

Description

Returns the centrality values of nodes in a graph using given method

Usage

get_centrality_scores(
  graph,
  centrality_method = c("DEGREE", "ECCENTRICITY", "AVERAGE_DISTANCE", "BARYCENTER",
    "BETWEENNESS", "BOTTLENECK", "CENTROID", "CLOSENESS", "CLUSTERRANK",
    "COMMUNITY_BETWEENNESS", "COMMUNITY_CENTRALITY", "CROSS_CLIQUE",
    "CURRENTFLOW_CLOSENESS", "DECAY", "EDGE_PERCOLATION", "EIGENVECTOR", "ENTROPY",
    "FREEMAN_CLOSENESS", "GEODESIC_K_PATH", "HUBBELL", "KATZ", "LAPLACIAN",
    "LATORA_CLOSENESS", "LEADERRANK", "LEVERAGE", "LINCENT", "LOBBY", "MARKOV",
    "MAX_NEIGHBORHOOD_COMPONENT", "MAX_NEIGHBORHOOD_DENSITY", "PAIRWISE_DISCONNECTIVITY",
         "RADIALITY", "RESIDUAL_CLOSENESS", "SALSA", "SEMILOCAL",
    "TOPOLOGICAL_COEFFICIENT", "VITALITY_CLOSENESS"),
  normalize = FALSE,
  estimate = FALSE,
  cutoff = 0,
  mode = "all"
)

Arguments

graph

is the igraph object

centrality_method

defines the centrality method to be used. Value must be among the values specificed in parameter centrality_method

normalize

scales the values in the output vector between 0 and 1

estimate

uses estimated method when true (should be used on large graphs). FALSE by default

cutoff

max value of path length as cutoff when estimate is TRUE. E.g. in betweenness, the calculation will be only till the path length of 3 if the cutoff = 3

Value

vector of centrality scores

Examples

{
graph <- erdos.renyi.game(500, 0.05)
get_centrality_scores(graph, centrality_method="DEGREE")
get_centrality_scores(graph, centrality_method="BETWEENNESS")
get_centrality_scores(graph, centrality_method="CLOSENESS")
get_centrality_scores(graph, centrality_method="EIGENVECTOR")
get_centrality_scores(graph, centrality_method="ECCENTRICITY")
get_centrality_scores(graph, centrality_method="BETWEENNESS", TRUE, 3)
}

seekme94/influence.mining documentation built on Aug. 2, 2022, 10:19 p.m.