Plot one or more centrality scores of all vertices in the network
a network of class igraph
or network
character vector of one or more centrality measures
logical, should direction be taken into account? This argument is optional, if it is not chosen the directionality of the network will be used.
Character. The default is "all".
The k parameter for the "geokpath" measure. The default is 3.
Logical scalar, whether to rescale the centrality scores to they add up to 1.
other arguments passed to plot
.
a plot
This function creates of grid of plots containing the values a set of centrality scores, selected by the user. The function will calculate the requested scores and then plot them. When a large network is used and many or complex measures are requested, the calculations can take some time. The plotting itself will be fast.
Since the function calculates the centrality scores itself, the choice is currently limited to the centralities implemented in this package.
At the moment, these are "betweenness", "closeness", "degree", "eccentricity", "eigenvector", "geokpath", "harmonic", "shapley", and "stress". The default is to plot "betweenness", "closeness", "degree", and "eccentricity".
The various arguments relate to these measures. The mode
,
directed
, and rescaled
arguments will be appled to all chosen
measures
The function takes an igraph
object or a network
object as input.
if (FALSE) { # \dontrun{
g <- igraph::erdos.renyi.game(20, 1/20)
plot_centralities(g, measures = c("degree", "betweenness"))
# note that closeness is not well-defined for disconnected graphs
plot_centralities(g)
data(florentine, package = "snafun")
business <- florentine$flobusiness
plot_centralities(business)
plot_centralities(business, rescaled = TRUE)
plot_centralities(business, measures = c("betweenness", "closeness", "degree",
"eccentricity", "eigenvector", "geokpath", "harmonic", "stress"))
bus_n <- snafun::to_network(business)
plot_centralities(bus_n, c("degree", "betweenness"), mode = "out", use_vertexnames = TRUE)
} # }