Skip to contents
  • 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 class 'cor.net'
plot(x, scale = 1.2, ...)

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

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

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

# S3 method for class 'dpi.dag'
plot(
  x,
  k = min(x$DPI$k.cov),
  show.label = TRUE,
  digits.dpi = 2,
  color.dpi.insig = "#EEEEEEEE",
  scale = 1.2,
  ...
)

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

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.

color.dpi.insig

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

Value

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