| cor_net | R Documentation |
Correlation and partial correlation networks (also called Gaussian graphical models, GGMs).
cor_net(
data,
index = c("cor", "pcor"),
show.label = TRUE,
show.insig = FALSE,
show.cutoff = FALSE,
faded = FALSE,
node.text.size = 1.2,
node.group = NULL,
node.color = NULL,
edge.color.pos = "#0571B0",
edge.color.neg = "#CA0020",
edge.color.non = "#EEEEEEEE",
edge.width.min = "sig",
edge.width.max = NULL,
edge.label.mrg = 0.01,
file = NULL,
width = 6,
height = 4,
dpi = 500,
...
)
data |
Data. |
index |
Type of graph: |
show.label |
Show labels of correlation coefficients and their significance on edges. Defaults to |
show.insig |
Show edges with insignificant correlations (p > 0.05). Defaults to |
show.cutoff |
Show cut-off values of correlations. Defaults to |
faded |
Transparency of edges according to the effect size of correlation. Defaults to |
node.text.size |
Scalar on the font size of node (variable) labels. Defaults to |
node.group |
A list that indicates which nodes belong together, with each element of list as a vector of integers identifying the column numbers of variables that belong together. |
node.color |
A vector with a color for each element in |
edge.color.pos |
Color for (significant) positive values. Defaults to |
edge.color.neg |
Color for (significant) negative values. Defaults to |
edge.color.non |
Color for insignificant values. Defaults to |
edge.width.min |
Minimum value of edge strength to scale all edge widths. Defaults to |
edge.width.max |
Maximum value of edge strength to scale all edge widths. Defaults to |
edge.label.mrg |
Margin of the background box around the edge label. Defaults to |
file |
File name of saved plot ( |
width, height |
Width and height (in inches) of saved plot. Defaults to |
dpi |
Dots per inch (figure resolution). Defaults to |
... |
Arguments passed on to |
Return a list (class cor.net) of (partial) correlation results and qgraph object.
S3method.network
DPI_dag()
BNs_dag()
# correlation network
cor_net(airquality)
cor_net(airquality, show.insig=TRUE)
# partial correlation network
cor_net(airquality, "pcor")
cor_net(airquality, "pcor", show.insig=TRUE)
# modify ggplot attributes
p = cor_net(airquality, "pcor")
gg = plot(p) # return a ggplot object
gg + labs(title="Partial Correlation Network")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.