forrest (development version)
forrest 0.3.0
New features
forrest()gains adodgeargument (logical or positive numeric, defaultFALSE). When set, consecutive rows that share the samelabelvalue are grouped together and their confidence intervals are drawn with a small vertical offset so they do not overlap. The shared label is displayed once at the centre of the group. Designed to be used withgroup(for colour) and/orshape(for point character) to visually distinguish the overlaid series. A numeric value controls the offset directly;TRUEuses a default of0.25y-axis units.forrest()gains ashapeargument (column name string, defaultNULL). When provided, different values of the column are rendered with different point characters from a built-in set (circle, triangle, square, diamond, …), and a shape legend is drawn automatically. Most useful in combination withgroupto encode two categorical dimensions simultaneously (e.g. colour = time period, shape = sex).forrest()gains alegend_shape_posargument (default"bottomright") to control the position of the shape legend independently oflegend_pos.forrest()gains acols_by_groupargument (defaultFALSE). WhenTRUEanddodgeis active, each text column incolsis collapsed to one value per label group displayed at the group centre y position. This produces a wide-format text table — one row per label, one column per condition — as commonly seen in multi-period epidemiology papers (vs. the default behaviour of stacking text at each individual row’s dodged y position).
Documentation
README quick-start gains a Multiple estimates per row example demonstrating
dodgewithgroup.README quick-start regression example now shows a formatted text column (
cols) and a panel header (header) alongside the plot, making all three core features visible in one place.Getting-started vignette gains two new sections: Multiple estimates per row and Point shapes.
Regression vignette: the Multiple predictors from one model example now includes a
cols = c("Coef (95% CI)" = "coef_ci")column and matchingheader, consistent with the logistic and dose-response examples.
Infrastructure
- Website URL added to
DESCRIPTIONURLfield.
forrest 0.2.0
New features
save_forrest()— new exported function to write a forest plot to a file. The graphics device (PDF, PNG, SVG, TIFF) is inferred from the file extension; resolution can be controlled viadpifor raster formats.forrest()gains astripeargument (FALSEby default). WhenTRUE, alternate rows are shaded with a light-grey background to improve readability in tables with many rows.
Documentation
Revised framing:
forrestis now documented as a general-purpose tool for any tabular estimates-and-CIs data, not only meta-analyses. The description, README, and vignettes have been updated accordingly.New vignette Forest plots for regression results covers four practical patterns: multiple predictors from one model, comparing estimates across adjustment models, same predictor across multiple outcomes, and dose-response (exposure categories). Examples use
broom::tidy()for parameter extraction.Getting-started vignette updated with a
stripeexample and a Saving plots section.README now leads with a regression-model example and an updated feature comparison table.
Refactoring
Drawing helpers (
draw_diamond(),draw_text_panel()) moved fromR/utils.Rto a dedicatedR/draw.R, improving code organisation.save_forrest()lives in its ownR/save.R.
Bug fixes
- Horizontal gridlines are now drawn at
lwd = 0.7(was0.8) for a slightly lighter appearance.
forrest 0.1.0
- Initial release.
forrest()creates publication-ready forest plots with support for subgroup headers, summary estimates (diamonds), grouped colour mapping, and optional text columns alongside the plot.forrest()gains aweightargument to scale point size proportionally to row weights.- Confidence intervals that extend beyond
xlimare clipped at the axis boundary; a directional arrow indicates the truncated side.