View source: R/plot-centrality.R
| plot_centrality | R Documentation |
Plots one or more centrality measures, one facet per measure. Accepts the
data frame from centrality or any network input.
plot_centrality(
x,
measures = NULL,
style = c("line", "bar", "lollipop", "dot"),
orientation = c("horizontal", "vertical"),
scale = c("raw", "normalized", "z", "rank"),
order_by = NULL,
top_n = NULL,
highlight = 0L,
cluster = NULL,
palette = "cograph",
ncol = NULL,
title = NULL,
subtitle = NULL,
...
)
x |
Output of |
measures |
Character vector of measure names. When |
style |
Character: "line" (default), "bar", "lollipop", or "dot". |
orientation |
Character: "horizontal" (default, nodes on y-axis) or "vertical" (nodes on x-axis). |
scale |
Character: "raw" (default, native units with a free value axis per facet), "normalized" (min-max scaled to [0, 1] within measure), "z" (standardized within measure), or "rank" (1 = highest value within measure). |
order_by |
Character. Name of the measure column that sorts the
nodes (e.g., "degree_all"), or |
top_n |
Optional integer. Keeps only the top-N nodes by
|
highlight |
Integer. In the "bar", "lollipop" and "dot" styles, the top-N nodes per measure are plotted in full color and the rest are muted. Default 0 (no highlighting). Ignored by the "line" style. |
cluster |
Optional cluster assignment of the nodes, given as the name
of a column of |
palette |
Currently unused. Cluster colors are taken from the built-in cograph palette. |
ncol |
Number of facet columns. Default |
title |
Plot title. Default NULL. |
subtitle |
Plot subtitle. Default NULL. |
... |
Passed to |
Four styles are available:
"line"Points connected by a line within each measure, with
nodes in the order set by order_by.
"bar"Bars of the measure values.
"lollipop"Segments ending in a dot.
"dot"Dots only.
A ggplot object.
plot_centrality(regulation_net)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.