Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:

name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
51 changes: 50 additions & 1 deletion R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,59 @@
#' \item{Within_4h}{Total attendances that were < 4 hours}
#' \item{Over_4h}{Total attendances that were > 4 hours}
#' \item{Percent_in_4h}{Percentage of attendances within 4 hours}
#' \item{E_Adm_ViaAE}{Total emergency admissions via emergency department}
#' \item{E_Adm_Via_ED}{Total emergency admissions via emergency department}
#' \item{E_Adm_Over_4h}{Total > 4 hours from decision to admit to admission}
#' }
#'
#' @source <https://www.england.nhs.uk/statistics/statistical-work-areas/ae-waiting-times-and-activity/ae-attendances-and-emergency-admissions-2023-24/>
#'
"ed_attendances_monthly"

#' Example Time Series 1
#'
#' A simulated example time series used in illustrating features of the Stable
#' Shift Algorithm.
#'
#' @format
#' A data frame with 125 rows and 2 columns
#' \describe{
#' \item{x}{Consecutive integer time}
#' \item{y}{Numeric time series}
#' }
#'
#' @source Simulated data
#'
"example_series_1"

#' Example Time Series 2a
#'
#' A second simulated example time series used in illustrating features of the
#' Stable Shift Algorithm.
#'
#' @format
#' A data frame with 43 rows and 2 columns
#' \describe{
#' \item{x}{Consecutive integer time}
#' \item{y}{Integer time series}
#' }
#'
#' @source Simulated data
#'
"example_series_2a"

#' Example Time Series 2b
#'
#' A third simulated example time series used in illustrating features of the
#' Stable Shift Algorithm. Identical to example_series_2a except at seven time
#' points, all occurring at or after x = 27.
#'
#' @format
#' A data frame with 43 rows and 2 columns
#' \describe{
#' \item{x}{Consecutive integer time}
#' \item{y}{Integer time series}
#' }
#'
#' @source Simulated data
#'
"example_series_2b"
6 changes: 6 additions & 0 deletions R/plot_code.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#' "XMR", "MR", "C", "C'", "P", "P'".
#'
#' ## Algorithm Parameters
#' Parameters that control behaviour of the algorithm used to re-establish
#' control limits.
#' @param periodMin The minimum number of points (subgroups) per period,
#' i.e. the minimum number of points required to form control limits.
#' @param baseline Integer, overrides periodMin for the first calculation period
Expand All @@ -51,6 +53,8 @@
#' calculation period. Set to FALSE only with noRegrets = FALSE.
#'
#' ## SPC Parameters
#' Parameters that control how cetnre line and control limits are established
#' for each period, and details of how SPC rules are applied
#' @param maxNoOfExclusions The maximum number of extreme points to exclude from
#' limit calculations.
#' @param highlightExclusions Boolean signifying whether excluded points are
Expand All @@ -73,6 +77,7 @@
#' floating median, if present.

#' ## Output Type
#' Arguments that control how the result is outputted
#' @param plotChart Boolean specifying whether to plot the chart. If not, the
#' data is returned with centre line, control limits and other analytic output
#' appended as columns.
Expand All @@ -90,6 +95,7 @@
#' log data is saved to. Full log data is saved, regardless of verbosity.
#'
#' ## Chart Appearance
#' Arguments that control aspects of chart visualisation
#' @param title Optional string specifying chart title. Overrides df$title.
#' @param subtitle Optional string specifying subtitle. Overrides df$subtitle.
#' @param use_caption Boolean controlling whether the caption is displayed.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<!-- badges: start -->
[![Codecov test coverage](https://codecov.io/gh/HorridTom/autospc/graph/badge.svg)](https://app.codecov.io/gh/HorridTom/autospc)
[![R-CMD-check](https://github.com/HorridTom/autospc/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/HorridTom/autospc/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

## Overview
Expand Down
Binary file modified data/example_series_1.rda
Binary file not shown.
Binary file removed flow charts spc algorithm.pptx
Binary file not shown.
6 changes: 6 additions & 0 deletions man/create_SPC_auto_limits_table.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/ed_attendances_monthly.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions man/example_series_1.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions man/example_series_2a.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions man/example_series_2b.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions man/plot_auto_SPC.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.