- The report now respects the
include_dq_icon
argument tospcr_make_report
. When set toFALSE
, the icons are removed from both the individual metric summary rows, and from the key at the bottom of the report.
- BREAKING CHANGE - Added the ability to create rare-event charts of type "T" (time-between).
- The report is now mobile friendly, and works on very narrow screens. The breakpoint from wide to narrow layout is 768px.
- The ability to add commentary was added previously, but now the method is demonstrated in the example config docs.
- Added explanation of the data-quality icons to the footer of the report.
- Added the ability to output ".pdf" reports, which include tidy page-breaks.
- Added the optional columns to the example excel config documents, to aid onboarding for new users.
- BREAKING CHANGE - The argument
export_csv
tospcr_make_report()
has been disused and replaced withoutput_type
which is now a vector of the required output types. Current valid options are "html", "pdf", and "csv". This method will allow addition of more report types in future. - File size reduced by approx 30% by handling plot resolution differently, and by a further 0.6MB by removing javascript, css, and font files bundled as part of RMarkdown. As a result of the latter change the template behaves less like standard Rmd and is more reliant on custom CSS, but as it is rarely edited the file size reduction is worth this trade-off.
- All spaces in the report name are now replaced with underscores. Previously only the first space was replaced.
- The CSV output now respects the
output_directory
argument. Previously this file was saved in the working directory regardless of the output_directory argument.
Associated with the addition of rare-event charts:
- The
report_config
now includes a mandatory columnspc_chart_type
. Valid values in this column are "xmr" or "t". - The
measure_data
now includes a mandatory list item (or excel worksheet) called "events". - The
data_cutoff_dttm
argument has been moved fromspcr_make_report()
tospcr_make_data_bundle()
to support the calculation of the final plotted point, which is placed to illustrate what would happen were an event to happen on this date.
Associated with the addition of pdf and csv output types:
- The the argument
export_csv
tospcr_make_report()
has been disused and replaced withoutput_type
.
- There is a new argument "annotate_limits" available for
spcr_make_report()
. By default it isTRUE
, and adds labels for the numeric values of the control limits and mean to the right of the plot.
- Fixed a bug which caused status messages to be printed in the main report if report generation is done on a slow computer.
- Fixed minor README argument name mistake, which would have thrown an error for new users.
This version introduces a large number of changes to the package. Some additional tests have been written, and existing tests amended to match the latest versions of functions.
- The
align_rebase_dates()
function now ensures that rebase dates not matching up with a data point are still observed and included in charts. This is achieved by moving the rebase date to the nearest data point following the rebase date. This should fix issue #35.
- The data bundle creation process now uses a more streamlined pipeline. This aims to make the various data preparation steps easier to follow and debug.
- The data bundle generated by
spcr_make_data_bundle()
is less comprehensive than in previous versions, omitting SPC chart data and focusing on providing human-readable source data forspcr_make_report()
.
- SPC data parcel creation and SPC chart creation are now handled within
spcr_make_report()
rather than being part of the data bundle. - Chart generation in the report is now based around an RMarkdown partial template (inst/Rmd/details_template.Rmd) which is mapped over by code within the main RMarkdown report template. This replaces the {htmltools} approach used in previous versions.
- Chart PNGs are now created as temp files and then converted to URI strings using
knitr::image_uri()
. These are injected into the HTML code directly, instead of using hyperlinks to PNG files. - The report now gets a custom title (it can be set in the
document_title
field) that is used for the<title>
tag in the HTML output. This is then shown as the document title in a browser tab. - The
export_csv
argument tospcr_make_report
now allows easy creation of a CSV file of the source data for the report, with the same timestamp as the HTML file. This addresses issue #17. - The report no longer auto-opens in the browser, nor plays a beep, when the creation process is complete. This behaviour could easily be restored if desired.
- Only the main user-facing functions now have the
spcr_
prefix. Other package functions are collected into two files,checking_functions
andhelper_functions
. - Several functions have been removed, being replaced or made obsolete by steps in the new bundle generation process.
- Example data already supplied with the package (as xlsx files in the
inst
folder) is now also available as internal package data, which can be used as example data for demonstrating package functions and also for facilitating testing.
-
Rebasing of SPC charts is now supported. Pass in a date string in "YYYY-MM-DD" format, or multiple date strings.
'"2020-01-01"'
, or'"2020-01-01", "2021-05-01"'
-
Stale data is now highlighted in the report. By default data is highlighted as stale if the report cutoff is after the data update date (as defined by the
updated_to
argument for the data, and thedata_cutoff_dttm
for the report). Optionally, a column calledallowable_days_lag
can be included in the measure_config. This can be used to delay the flagging of stale data. For example using a value of 31 in theallowable_days_lag
column will enable a measure to be reported a month in arrears without being flagged as stale.
- Fixes an issue where if there are mismatches in measure_name across any of the 3 supplied dataframes (measure_data, report_config, measure_config) the error message throw reported missing data.
Error: spcr_check_dataset_is_complete: Data is missing for 1 report items. The first is ref 1, M1, monthly.
The correct and more helpful error in this case is to complain of the name mismatch:Error: spcr_check_measure_names: There is a name mismatch for measure ref: 1. Check for typos or mismatching refs or data.
- Improved progress messages during
spcr_make_data_bundle()
to support debugging of incoming data.
- Fix a bug relating to NAs in the dataset which was causing printed warnings in the final report, as well as blank space in the charts. The new behaviour strips NAs from all data, meaning that the chart axis starts at the first data point, and ends at the last.
- Add two new optional columns to the measure_config: "Reviewed At", and "Escalated To". If present the text in these fields is rendered into the final report below each chart.
- Fixed an error caused when measure_data contained NAs. The package will now tolerate NAs in the data.
- Significant improvements to error messages relating to measure_data, report_config, and measure_config. Error messages now explicitly name any required columns which the user has not supplied. This is intended to make troubleshooting simpler to do.
- The data source for metrics is now named in charts as a caption.
- Other minor useability improvements intended to make working with real-world config documents easier to do.
measure_data
requires data for only one (or more) of "week" or "month".measure_data
tolerates capitalised list (worksheet) names.- Use the base pipe |> in place of %>%.
- Throw a helpful error if insufficient data items have been provided for a given report.
- Fixes an error occurring when targets are not set for any of the reported measures
spcr_make_data_bundle()
spcr_make_report()