Skip to content

UtilsR v0.6.1 -- fmt_strip re-application fix

Latest

Choose a tag to compare

@HUI950319 HUI950319 released this 06 May 03:35
· 966 commits to master since this release

Patch release fixing fmt_strip() re-application failure.

Bug fix

fmt_strip() previously crashed with "Can't convert a call to a string." when applied to a plot whose first fmt_strip() pass had injected a synthetic .strip_label. facet (no-facet branch wrote a CALL quosure that the has-facet branch could not resolve via rlang::as_name()).

Two-layer fix (R/fmt_plot.R)

  1. Source side (no-facet branch): use rlang::sym(".strip_label.") to produce a bare symbol.
  2. Recovery side (has-facet branch): tolerant .extract_var_name() helper that tries as_name() first, falls back to parsing .data[[...]] calls, and drops unparseable entries.

Reproducer

Any patchwork composition where each sub-plot was passed through fmt_strip() once before being wrapped, then fmt_strip() is applied to the wrapped patchwork. Encountered downstream in MLR's .plt_vd.cat.group_sur and .plt_vd.cat.group helpers.

No public API change; behavior preserved for single-pass fmt_strip() usage.

See NEWS.md for the complete change log.