CRAN preparation.
- The difference label is now drawn with plotmath (
Delta ~ "= +4.2%") and an ASCII minus sign, so it renders on every graphics device including thepdf()device used byR CMD check. Previously the literal U+0394 and U+2212 glyphs failed with "conversion failure ... mbcsToSbcs" on devices with single-byte encodings. - Multi-line
@importFromtags joined;NAMESPACEis now generated by roxygen2. dplyr,gridandmagrittrremoved from Imports (never used)..Rbuildignoreadded; developer notes no longer ship in the tarball.
Publication-quality rendering refinements.
mirror_slope_plot()gainsy_percent(defaultTRUE) to format y-axis ticks and header statistics with a percent sign; setFALSEfor absolute-scale outcomes.mirror_slope_plot()gainsjitter_points(defaultFALSE) to spread overlapping individual endpoints horizontally for readability, reproducible viaseed.
- Directional "to " arrows now flow inward toward the centre on both arms, reinforcing that the horizontal axis is positional and not a time axis.
- The baseline reference line at zero is now a clearer dashed line, and a dashed vertical guide marks the central convergence axis.
- Footnotes with embedded line breaks render as multiple left-aligned lines.
- Header statistics show a percent sign when
y_percent = TRUE. - The between-group annotation is now drawn as a bracket sized to the treatment gap (with end serifs), rather than a rule sized to the text block, so the bracket measures the difference it labels.
-
Individual trajectory lines are now drawn from each subject's baseline to the central endpoint only, grouped by arm and subject, so no line crosses the centre or connects across arms. This removes the main source of visual clutter.
-
Mean-endpoint diamonds now sit on a small white halo so they read cleanly where the converging lines crowd the central knot.
-
Directional arrows are lighter and smaller, receding as chart furniture.
-
The difference bracket is now a thin hairline matching the axis weight, with short inward serifs and more space before the annotation text, for a cleaner measurement mark.
-
Chart furniture (axis lines, ticks, gridlines, reference lines, arrows) now uses a single coherent light hairline family so nothing competes with the data.
-
Slope echoes are shorter and more muted, reading as a subtle continuation hint rather than data.
-
theme_mirror()now sets a clean sans typeface, a clear title/subtitle/caption hierarchy, and refined spacing;base_familydefaults to a Helvetica/Arial/sans stack and can be overridden. -
Default mean-line width and marker size were reduced slightly for print.
-
save_pathdocuments vector output (.pdf/.svg) for journal submission.
Initial release.
prep_mirror_data()prepares a long analysis dataset into amirror_dataobject: validates structure, applies population flags with AND logic, retains baseline and endpoint visits, assigns role columns, counts analysed N per arm, and records provenance metadata (schema version, filters, timestamp, call).add_summary()attaches group-level estimates and the baseline each mean line is drawn from, supporting both change-from-baseline (baseline 0) and absolute-scale outcomes.add_precision()attaches per-arm standard errors or confidence intervals.add_difference()attaches the between-arm difference with optional standard error, confidence interval, and p-value; warns on sign inconsistency.mirror_slope_plot()renders the figure as a standardggplotobject. Optional elements (individual trajectories, difference band, relative-benefit annotation, per-arm precision, N in the strip header) are off by default and shown only on request. The annotation zone auto-expands the x-axis without altering the data panel.mirror_palette()provides"default","colorblind"(Okabe-Ito), and"capricor"palettes.theme_mirror()supplies a publication theme with proportional text scaling.- S3 methods
print(),summary(), andas.data.frame()formirror_data.
- The
mirror_datastructure conforms to a versioned specification (schema 1.0) shared with a companion SAS macro, so both tools produce equivalent figures from equivalent inputs. directiondescribes the direction of numeric movement (endpoint versus baseline). For outcomes where the favourable direction is unusual, supplyoutcome_labelandbenefit_labelexplicitly.
- Right-to-left and non-Latin arm labels in strip headers are not yet supported.
- Multi-endpoint layouts are produced by combining plots with an external layout
package such as patchwork rather than within
mirrorslope.