Skip to content

v0.2.0 — XbarS charts, and missing values handled consistently

Choose a tag to compare

@HorridTom HorridTom released this 30 Sep 08:58
· 103 commits to master since this release
ae3a351

This release adds the XbarS chart, improves how missing values are handled, and
makes the table of results the same shape for a given chart type whatever the
data. It also gives notice of changes coming in 0.3.0, listed at the end.

Breaking changes

The results table. For MR, P and P' charts, y now holds the values you
supplied, and a new column series holds the values analysed and plotted (the
moving ranges, or the percentages). y_numerator is gone. Code that reads these
columns needs series in place of y, and y in place of y_numerator. Every
chart type also returns a new column, sd_estimate, and a new column
limit_extension, and autospc(plot_chart = FALSE) and as.data.frame() on a
plot now return the same table. The label placement columns cl_label,
annotation_level and annotation_curvature have gone from it, as have the P
and P' working columns constant, pbar, ucl_display and lcl_display.

Results that change.

  • Missing values: a calculation period now holds period_min points rather
    than period_min rows, control limits carry across a gap, and a missing point
    no longer silently splits a run (see the new argument na_ends_run).
  • A point on the centre line no longer ends the run it sits in.
  • The exact values of d2 and D4 are used, so X, C' and P' limits sit 0.034%
    closer to the centre line; options(autospc.rounded_constants = TRUE)
    restores the rounded values.
  • Limits are constrained to the range the statistic can take on every row;
    options(autospc.constrain_limits = FALSE) turns this off.
  • Limits extended with extend_limits_to start one subgroup's gap after
    the last subgroup, and on P and P' charts are placed more consistently. Only
    the extension rows change.

Data that is refused. X, MR and XMR charts reject a repeated x. P and P'
charts refuse a numerator outside 0 to n, and a negative denominator.

override_annotation_dist and override_annotation_dist_P, defunct since
0.1.0, have gone. Use upper_annotation_sf and lower_annotation_sf.

New

  • XbarS charts. chart_type = "XbarS" draws an Xbar chart of subgroup
    means above an S chart of subgroup standard deviations, and "Xbar" and "S"
    draw either on its own. Give one row per measurement, or rows summarising
    measurements by their mean (y), number (n) and sample standard deviation
    (the new argument s). See vignette("data-requirements").
  • override_y_lim sets the lower end of the vertical axis as well as the upper,
    and the axis zooms rather than clipping, so nothing is dropped from the drawing.
  • aggregation_na_rm chooses whether an observation with no value makes its
    subgroup missing (the default) or is left out.
  • Package options autospc.rounded_constants, autospc.constrain_limits
    and autospc.warn_missing_x, documented in ?autospc-package.
  • Argument checks for the text, colour and date format arguments, and
    clearer errors for a column that is not in the data.

Fixes

Includes: facet_stages() with a paired chart type held in a variable, with
no stage long enough for limits, or with a single stage; a floating median on a
short series; a spurious warning about max() on series shorter than
floating_median_n; and the dates in ed_attendances_monthly, which were
sometimes the last day of the previous month.

Coming in 0.3.0

These warn now, so that nothing changes without notice.

  • The default of max_exclusions will change from 3 to 0, so that points are
    excluded from a period's limits only when you ask for it. Where points are
    excluded this moves the limits, and can change where they are re-established.
    Until then, a call that leaves max_exclusions unset and excludes points
    warns. Set max_exclusions = 3 to keep your current results, or 0 to adopt
    the new default now.
  • show_mr, write_table and facet_stages(split_rows) will be removed.
    Use chart_type, plot_chart = FALSE and split_at. split_at counts points on
    the chart rather than rows of the data; where the data already holds one row
    per subgroup, in x order, the two are the same.
  • no_regrets = TRUE with overhanging_reversions = FALSE will become an
    error.

Full details

See NEWS.md for the
complete list, with what each change does and why.

Installing

remotes::install_github("HorridTom/autospc@v0.2.0")