Learn R Programming

DPI (version 2025.11)

S3method.network: [S3 methods] for cor_net(), BNs_dag(), and DPI_dag().

Description

  • Transform qgraph into ggplot

    • plot(cor.net)

    • plot(bns.dag)

    • plot(dpi.dag)

  • Plot network results

    • print(cor.net)

    • print(bns.dag)

    • print(dpi.dag)

Usage

# S3 method for cor.net
plot(x, scale = 1.2, ...)

# S3 method for cor.net print(x, scale = 1.2, file = NULL, width = 6, height = 4, dpi = 500, ...)

# S3 method for bns.dag plot(x, algorithm, scale = 1.2, ...)

# S3 method for bns.dag print( x, algorithm = names(x), scale = 1.2, file = NULL, width = 6, height = 4, dpi = 500, ... )

# S3 method for dpi.dag plot( x, k = min(x$DPI$k.cov), show.label = TRUE, digits.dpi = 2, faded.dpi = FALSE, faded.dpi.limit = c(0, 0.25), color.dpi.insig = "#EEEEEEEE", scale = 1.2, ... )

# S3 method for dpi.dag print( x, k = min(x$DPI$k.cov), show.label = TRUE, digits.dpi = 2, faded.dpi = FALSE, faded.dpi.limit = c(0, 0.25), color.dpi.insig = "#EEEEEEEE", scale = 1.2, file = NULL, width = 6, height = 4, dpi = 500, ... )

Value

Return a ggplot object that can be further modified and used in ggplot2::ggsave() and cowplot::plot_grid().

Arguments

x

Object (class cor.net / bns.dag / dpi.dag) returned from cor_net() / BNs_dag() / DPI_dag().

scale

Scale the grob object of qgraph on the ggplot canvas. Defaults to 1.2.

...

Other arguments (currently not used).

file

File name of saved plot (".png" or ".pdf").

width, height

Width and height (in inches) of saved plot. Defaults to 6 and 4.

dpi

Dots per inch (figure resolution). Defaults to 500.

algorithm

[For bns.dag] Algorithm(s) to display. Defaults to plot the finally integrated DAG from BN results for each algorithm in x.

k

[For dpi.dag] A single value of k.cov to produce the DPI(k) DAG. Defaults to min(x$DPI$k.cov).

show.label

[For dpi.dag] Show labels of partial correlations, DPI(k), and their significance on edges. Defaults to TRUE.

digits.dpi

[For dpi.dag] Number of decimal places of DPI values displayed on DAG edges. Defaults to 2.

faded.dpi

[For dpi.dag] Transparency of edges according to the value of DPI. Defaults to FALSE.

faded.dpi.limit

[For dpi.dag] Lower and upper limits of abs(DPI) for "00" and "FF" transparency of edges. Defaults to c(0, 0.25).

color.dpi.insig

[For dpi.dag] Edge color for insignificant DPIs. Defaults to "#EEEEEEEE" (faded light grey).