| plot_bootstrap_forest | R Documentation |
Plots bootstrap results of net_bootstrap,
net_bootstrap_group, tna_bootstrap and boot_glasso
objects as a ggplot2 forest plot. Each row is one non-zero network edge.
A square marks the point estimate, a horizontal bar spans the selected
interval, and a dashed reference line marks zero. Significant edges are
plotted in sig_color and non-significant edges in a faded
nonsig_color.
plot_bootstrap_forest(x, ...)
## S3 method for class 'net_bootstrap'
plot_bootstrap_forest(
x,
alpha = NULL,
layout = c("linear", "circular", "grouped"),
interval = c("ci", "cr", "both"),
show_nonsig = TRUE,
sort_by = c("estimate", "significance", "name"),
n_top = NULL,
node_colors = NULL,
sig_color = "#2C6E8A",
cr_color = "#D4829A",
nonsig_color = "#CCCCCC",
ring_color = "#C8C8C8",
median_color = "#AAAAAA",
label_size = NULL,
label_color = NULL,
point_size = NULL,
r_inner = NULL,
r_outer = NULL,
gap_rad = NULL,
label_offset = NULL,
src_label_size = NULL,
margins = c(0.1, 0.1, 0.1, 0.1),
scale = 1,
title = NULL,
subtitle = NULL,
...
)
## S3 method for class 'tna_bootstrap'
plot_bootstrap_forest(
x,
alpha = NULL,
layout = c("linear", "circular", "grouped"),
interval = c("ci", "cr", "both"),
show_nonsig = TRUE,
sort_by = c("estimate", "significance", "name"),
n_top = NULL,
node_colors = NULL,
sig_color = "#2C6E8A",
cr_color = "#D4829A",
nonsig_color = "#CCCCCC",
ring_color = "#C8C8C8",
median_color = "#AAAAAA",
label_size = NULL,
label_color = NULL,
point_size = NULL,
r_inner = NULL,
r_outer = NULL,
gap_rad = NULL,
label_offset = NULL,
src_label_size = NULL,
margins = c(0.1, 0.1, 0.1, 0.1),
scale = 1,
title = NULL,
subtitle = NULL,
...
)
## S3 method for class 'boot_glasso'
plot_bootstrap_forest(
x,
alpha = NULL,
layout = c("linear", "circular", "grouped"),
interval = c("ci", "cr", "both"),
show_nonsig = TRUE,
sort_by = c("estimate", "significance", "name"),
n_top = NULL,
node_colors = NULL,
sig_color = "#2C6E8A",
cr_color = "#D4829A",
nonsig_color = "#CCCCCC",
ring_color = "#C8C8C8",
median_color = "#AAAAAA",
label_size = NULL,
label_color = NULL,
point_size = NULL,
r_inner = NULL,
r_outer = NULL,
gap_rad = NULL,
label_offset = NULL,
src_label_size = NULL,
margins = c(0.1, 0.1, 0.1, 0.1),
scale = 1,
title = NULL,
subtitle = NULL,
...
)
## S3 method for class 'net_bootstrap_group'
plot_bootstrap_forest(
x,
layout = c("linear", "circular"),
interval = c("ci", "cr", "both"),
show_nonsig = TRUE,
n_top = NULL,
all_edges = FALSE,
pos_color = NULL,
title = NULL,
subtitle = NULL,
label_size = 2.8,
...
)
x |
A |
... |
Currently unused. |
alpha |
Significance threshold. Default |
layout |
|
interval |
Which interval to display: |
show_nonsig |
Logical. Include non-significant edges.
Default |
sort_by |
Order of edges on the y-axis in the linear layout:
|
n_top |
Integer. Keeps only the |
node_colors |
Optional named vector of node colors for the grouped layout. When NULL, node colors stored in the original network or tna model are used if present. |
sig_color |
Color for significant CI bars and points (linear and
circular layouts). Default |
cr_color |
Color for the consistency range bar ( |
nonsig_color |
Color for non-significant edges (linear and circular
layouts). Default |
ring_color |
Color for the reference rings (circular and grouped
layouts). Default |
median_color |
Color for the dashed median ring (circular and grouped
layouts). Default |
label_size |
Text size for edge labels (circular and grouped layouts).
Default |
label_color |
Fixed color for edge labels (circular and grouped
layouts). |
point_size |
Size of the estimate square. Default |
r_inner |
Inner ring radius (grouped layout). Default |
r_outer |
Outer ring radius (grouped layout). Default |
gap_rad |
Gap in radians between sectors (grouped layout). Default |
label_offset |
Distance between outer ring and labels (grouped layout). Default |
src_label_size |
Text size for source node labels in the center (grouped layout).
Default |
margins |
Margins as |
scale |
Scaling factor applied to all text and point sizes (grouped layout).
Default |
title |
Plot title. Default |
subtitle |
Plot subtitle. Default |
all_edges |
For |
pos_color |
Currently unused by the |
Objects from stability inference (net_bootstrap and
tna_bootstrap) carry both a bootstrap confidence interval and a
consistency range, and interval = "both" overlays the two. When the
consistency range is requested but absent, a message is issued and the
confidence interval is shown. For boot_glasso, an edge is
significant when its inclusion proportion is at least 1 - alpha.
The net_bootstrap_group method plots the groups side by side in
the linear layout, with the edges ordered by their mean estimate across
groups. Its interval = "both" shows the confidence interval only,
and its circular layout shows the first group only.
A ggplot object.
boot <- tna::bootstrap(tna::tna(coding), iter = 50)
plot_bootstrap_forest(boot)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.