View source: R/plot-centrality.R
| plot_centrality_compare | R Documentation |
Plots one centrality measure across two or more groups as stacked,
faceted, grouped, dumbbell, line, or pyramid charts. The
"pyramid" style is a back-to-back horizontal bar chart for exactly
two groups. Groups are aligned on the node names they share.
plot_centrality_compare(
...,
measure = NULL,
style = c("stacked", "facet", "grouped", "dumbbell", "line", "pyramid"),
group_labels = NULL,
group_colors = NULL,
node_colors = NULL,
sort_by = c("max", "delta", "first", "alpha"),
top_n = NULL,
scale = c("raw", "normalized"),
show_values = TRUE,
size_by_value = FALSE,
size_range = c(2, 9),
orientation = c("horizontal", "vertical"),
ncol = NULL,
title = NULL,
subtitle = NULL,
centrality_args = list()
)
... |
Two or more centrality data frames (from
|
measure |
Character, a single centrality measure to compare. For network inputs, a name such as "strength" also matches a shared column with an "_all", "_in" or "_out" suffix when the match is unique. For centrality data frames, it must be an exact column name. If NULL, the first shared measure is used. |
style |
Character: |
group_labels |
Character vector with one label per group. Default
|
group_colors |
Character vector of colors, one per group. Default cycles through the cograph palette. |
node_colors |
Colors of the nodes in |
sort_by |
|
top_n |
Show top N nodes (by |
scale |
|
show_values |
Logical. Print the value of each bar or point. Default TRUE. |
size_by_value |
Logical. For |
size_range |
Numeric vector of length 2 giving the min and max
dot size (mm) when |
orientation |
Character: |
ncol |
Number of facet columns for |
title |
Plot title. NULL (default) gives "Centrality comparison:" followed by the measure name. |
subtitle |
Plot subtitle. When NULL, the |
centrality_args |
Named list of additional arguments passed to
|
A ggplot object.
plot_centrality_compare(Full = regulation_net,
Strong = threshold_edges(regulation_net, minimum = 0.1), measure = "strength")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.