get_net | R Documentation |
Make a quick network graph
get_net(
df = NULL,
cv = NULL,
n = NULL,
title = "Model",
legend = "none",
gamma = 0.3,
layout = "fr",
start = "glasso",
stepwise = T,
seed = 1,
group.id = NA,
item_label = function(x) gsub("\\D", "", x),
return.df = F
)
df |
Data frame |
cv |
Correlation matrix (if df is NULL) |
title |
Title of the plot |
legend |
Legend position |
gamma |
Gamma parameter for the model selection function, see 'ggmModSelect' |
layout |
Default is "fr". Network layout. See more at 'ggraph::ggraph' |
start |
Default is "glasso", see 'ggmModSelect' |
stepwise |
Default is TRUE, see 'ggmModSelect' |
seed |
Attempt to make plots replicable. |
group.id |
Vector of regex expressions to apply to variable names and use it to group variables. |
item_label |
Function that converts the item names to node labels. |
return.df |
Logical, if true, returns tidygraph dataset instead of the plot. |
data("HolzingerSwineford1939", package = "lavaan")
get_net(HolzingerSwineford1939[, 7:15],
group.id = c(first.factor = "1|2|3",
second = "4|5|6",
third = "7|8|9"),
legend = "bottom"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.