Skip to content

v0.1.0 — SPC charts are now objects

Choose a tag to compare

@HorridTom HorridTom released this 28 Aug 09:55
· 211 commits to master since this release
e90a6b3

The package is rewritten around S3 classes. A chart is now an object that carries both the
specification of an analysis and its results, and behaviour that used to be chosen by testing
chart_type is a method on the chart's class. autospc() returns a ggplot that carries the
analysed chart it was drawn from.

Every argument of autospc() and facet_stages() behaves as it did, apart from the changes listed
below, and every chart is drawn as it was.

Breaking changes

Seven columns of the returned table are renamed from camelCase to snake_case, so that every
column of the table is named the same way. The values are unchanged.

Was Is now
periodType period_type
breakPoint break_point
aboveOrBelowCl above_or_below_cl
runStart run_start
limitChange limit_change
periodStart period_start
plotPeriod plot_period

Code that reads these by name — filtering on periodType == "calculation", for instance — needs
to be updated. The columns that were already snake_case are unaffected, as are x, y, n, cl,
ucl, lcl and the moving range columns.

override_annotation_dist and override_annotation_dist_P are now defunct. They have warned
since 0.0.0.9010; supplying either is now an error. Use upper_annotation_sf and
lower_annotation_sf.

create_SPC_auto_limits_table() is no longer exported.

A chart has no x axis title unless you give one. The default was "Day" whatever the x column
held, so a chart of monthly data was labelled "Day" too. Use override_x_title for a title of your
own.

Deprecations

These still work, and warn.

  • autospc(write_table) no longer writes a file. Save the results yourself:
    autospc(plot_chart = FALSE) returns them as a data frame, and as.data.frame() on the object
    autospc() returns does the same.
  • autospc(show_mr) and facet_stages(show_mr) — use chart_type instead.
    chart_type = "X" draws the X chart on its own and chart_type = "XMR" draws the pair.

New

  • chart_type = "X" and chart_type = "MR" draw either half of an XmR chart on its own.
  • autospc() returns a plot object that carries its analysis. It is still a ggplot — printing,
    ggsave() and adding ggplot2 layers all work as before — and as.data.frame() on it now returns
    the analysed table. For an XmR chart it returns both halves joined side by side, with the moving
    range and its limits as mr, amr, url and lrl.
  • autospc(keep_candidate_tables), FALSE by default, keeps the limits tables of periods the
    algorithm considered and rejected, for anyone wanting to show why a decision was made.

Fixes

Twelve, including: a spurious warning when a column is named x, y or n; log_file_path
writing one file per chart rather than one per call; facet_stages() failing to label its axes;
chart_type = "XMR" failing when autospc() was called from another function; and the series not
being sorted by x before limits were calculated.

Full details

See NEWS.md for the complete list, with
the reasoning for each change.

Installing

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

A note on the version number

0.1.0 is a first release, not a stable interface. Under semantic versioning anything below
1.0.0 may still change; 1.0.0 will be the version that promises stability.