NHSRplotthedots icon indicating copy to clipboard operation
NHSRplotthedots copied to clipboard

Consider a reporting aid function

Open ThomUK opened this issue 2 years ago • 0 comments

A major use-case for the package is to support routine reporting in the #plotthedots style.

I propose adding a convenience function such as ptd_get_report_info(), which would accept the ptd_spc() dataframe, and return a list object containing:

  • The dataframe (as a source of truth)
  • The ggplot object (pre-calculated and ready to drop into eg. RMarkdown documents)
  • The chart title & subtitle (for convenience and use on reports)
  • The "name" of the variation icon (to enable swapping icons in on final reports)
  • The "name of the assurance icon
  • Some short canned text explaining the meaning of the variation and assurance (MDC team have some good practice on this)
  • The target value with appropriate rounding and % sign if percentage data (for convenient use on reports)
  • The value of the last 3 points (again with rounding and % signs if appropriate), and their corresponding dates
  • When #122 is implemented the type of variation (reason for the special cause) could be included

This object could be used to simplify reporting by consolidating all the information needed in one place.
Using it would then be a case of using:

my_spc$title
my_spc$sub-title
my_spc$target
my_spc$last_point_value
my_spc$last_point_date
my_spc$variation_type
my_spc$assurance_type
my_spc$ggplot_chart
etc...

ThomUK avatar Jun 16 '22 16:06 ThomUK