Description Usage Arguments Value Examples
View source: R/graph_centrality.R
graph_centrality
graphs the network (as a graph object) overlapped with the
specified centrality score. This function only performs the graphing and not
any computation
1 2 3 4 5 6 7 | graph_centrality(
graph,
centr_score,
main = "Centrality Network",
seed = 1,
legend = T
)
|
graph |
A graph object as defined in the |
centr_score |
A length- |
main |
A custom string. Title of the plot. |
seed |
A seed value that can be custom specified. Default is 1. |
legend |
A boolean specifying if we want to display the legend or not |
Function has no return value. It makes a cute plot though.
1 2 3 4 5 | A.mat = sim_adjacency(10, mode = "undirected") # symmetric; all edge weights 1
A.graph = igraph::graph_from_adjacency_matrix(A.mat, mode = "undirected")
c.deg.und = degree(A.mat, type = "undirected") # calculate centrality score
graph_centrality(A.graph, c.deg.und, main = "Degree Centrality (undirected)")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.