| geom_forestpoint | R Documentation |
geom_forestpoint() draws the central markers in a forest plot:
non-summary rows are rendered as squares whose area is controlled by the
ggplot2 size aesthetic (typically proportional to precision), while summary
rows are rendered as diamonds whose width reflects the confidence interval
and whose height is derived from that width and bounded by row spacing.
geom_forestpoint(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
diamond_aspect = 1,
diamond_row_frac = 0.4,
diamond_min_frac = 0.06,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. If |
stat |
Statistical transformation to use. Defaults to |
position |
Position adjustment. Defaults to |
... |
Additional arguments passed to the underlying |
diamond_aspect |
Numeric. Controls how strongly the diamond height increases with confidence interval width. Larger values produce taller diamonds. |
diamond_row_frac |
Numeric in (0, 1). Maximum fraction of the vertical row spacing that the diamond half-height may occupy, preventing overlap with adjacent rows. |
diamond_min_frac |
Numeric in (0, 1). Minimum fraction of the row spacing used as the diamond half-height, ensuring visibility for very narrow confidence intervals. |
na.rm |
Logical. If |
show.legend |
Logical or |
inherit.aes |
Logical. If |
This geom is designed to work with standard ggplot2 scales (e.g.,
scale_size_area()) and pairs naturally with geom_linerange() for confidence
intervals and geom_foreststripe() for background striping.
For non-summary rows, the square side length is derived from the ggplot2
size aesthetic (in mm units), so users can control point sizing using
standard size scales such as ggplot2::scale_size_area().
For summary rows, the diamond width is determined by the supplied confidence
interval (xmin/xmax), and the height is computed as a bounded function of
that width. The diamond height does not use the size aesthetic.
A ggplot2 layer object that can be added to a plot.
# geom_forestpoint() is designed to be used as part of gg_forest().
# See ?gg_forest for a complete runnable example.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.