View source: R/layout_valence.R
layout_valence | R Documentation |
Valence-based layout
layout_valence(
.data,
times = 500,
center = NULL,
circular = FALSE,
repulsion_coef = 1,
attraction_coef = 0.05
)
layout_tbl_graph_valence(
.data,
times = 500,
center = NULL,
circular = FALSE,
repulsion_coef = 1,
attraction_coef = 0.05
)
.data |
Some |
times |
Integer of sweeps that the algorithm will pass through. By default 4. |
center , circular |
Extra parameters required for |
repulsion_coef |
Coefficient for global repulsion force. Default is 1. |
attraction_coef |
Coefficient for edge-based attraction/repulsion force. Default is 0.05. |
edges <- data.frame(
from = c("A", "B", "C", "D"),
to = c("B", "C", "D", "A"),
weight = c(2, 3, 1, 4),
sign = c(1, -1, 1, -1) # 1 = positive, -1 = negative
)
graphr(as_igraph(edges), layout="valence")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.