View source: R/network_functions.R
springNet | R Documentation |
Generate spring-embedded network from similarity matrix
springNet(
smat,
layout = "nicely",
group_by = NULL,
cex_line = 0.1,
knn = 5,
min_edge = quantile(smat, 0.95),
dual_criteria = F,
node_label_size = NULL,
node_size = 1,
label_as_node = F,
remove_unconnected_nodes = F,
seed = 1023
)
smat |
similarity matrix |
layout |
layout used to embded network. Default is "nicely", |
group_by |
group variable used to color network nodes |
cex_line |
edge width |
knn |
k-nearest neighbors. Default is 5. If not specified, defaults to min_edge argument. |
min_edge |
similarity threshold used to display network edge |
dual_criteria |
if knn and min_edge are both specified, edges are included if either condition are met. |
node_label_size |
size of node labels. If not specified (i.e., node_label_size = NULL), no label is shown. |
node_size |
size of network nodes. Default is 1. |
label_as_node |
replace nodes with labels. Default is F. |
remove_unconnected_nodes |
remove unconnected nodes in graph. Default is F. |
seed |
number used to initialize pseudorandom number generator. Specify to ensure reproducible graphs. Default is 1023. |
ggplot
Nicholas Mikolajewicz
smat <- cor(x)
springNet(smat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.