View source: R/plot-communities.R
| overlay_communities | R Documentation |
Render a network with splot and overlay smooth blob
shapes highlighting node communities.
overlay_communities(
x,
communities,
blob_colors = NULL,
blob_alpha = 0.25,
blob_linewidth = 0.7,
blob_line_alpha = 0.8,
...
)
x |
A network object passed to |
communities |
Community assignments in any format:
a method name (e.g., |
blob_colors |
Character vector of fill colors for blobs. Recycled if shorter than the number of communities. |
blob_alpha |
Numeric. Fill transparency (0-1). |
blob_linewidth |
Numeric. Border line width. |
blob_line_alpha |
Numeric. Border line transparency (0-1). |
... |
Additional arguments passed to |
The splot result (invisibly).
set.seed(1)
mat <- matrix(runif(25), 5, 5,
dimnames = list(LETTERS[1:5], LETTERS[1:5]))
diag(mat) <- 0
overlay_communities(mat, list(g1 = c("A","B"), g2 = c("C","D","E")))
model <- tna::tna(tna::group_regulation)
comm <- cograph::communities(model$weights, method = "infomap")
overlay_communities(model, comm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.