View source: R/fp_decorate_graph.R
| fp_set_favors | R Documentation |
Adds left/right "Favours ..." indicators with optional arrows either inside the graph (just above the x-axis) or outside (below the x-axis labels).
fp_set_favors(
x,
low = "Group 1",
high = "Group 2",
arrows = TRUE,
position = c("outside", "inside"),
txt_gp = NULL,
arrow_gp = NULL,
label_x_nudge = NULL,
label_y_nudge = NULL
)
x |
The forestplot object |
low |
Label for the lower (left) side. Can be a character string or
decorated with |
high |
Label for the upper (right) side. Can be a character string or
decorated with |
arrows |
Should arrows pointing away from the center be drawn? |
position |
Where to draw the indicators: |
txt_gp |
Optional |
arrow_gp |
Optional |
label_x_nudge |
Horizontal nudge for favors labels from the arrow heads.
Accepts |
label_y_nudge |
Vertical nudge for favors labels. Accepts |
The forestplot object with favors indicators
Other graph modifiers:
fp_add_lines(),
fp_decorate_graph(),
fp_insert_row(),
fp_set_style(),
fp_set_zebra_style()
Other forestplot functions:
forestplot(),
fpColors(),
fpDrawNormalCI(),
fpLegend(),
fpShapesGp(),
fp_add_lines(),
fp_decorate_graph(),
fp_insert_row(),
fp_set_style(),
fp_set_zebra_style()
data(dfHRQoL)
sweden <- dfHRQoL[dfHRQoL$group == "Sweden", ]
sweden$est <- sprintf("%.2f", sweden$mean)
sweden |>
forestplot(
labeltext = c(labeltext, est),
mean = mean,
lower = lower,
upper = upper,
clip = c(-.1, Inf),
xlab = "EQ-5D index"
) |>
fp_set_favors(
low = "worse",
high = "better",
txt_gp = gpar(cex = 0.8)
) |>
fp_set_style(
box = "royalblue",
line = "darkblue",
summary = "royalblue"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.