Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue #184: added summary() to README #198

Merged
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
15 changes: 15 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ sub_set %>%
main_title = "SPC of A&E waiting time breaches for RQM"
)
```
In addition, you can use summary() function to get some basic statistics about your SPC data frame.
The function prints the SPC options, and then returns the summarised results as a table:
```{r, eval=TRUE}
summary<-sub_set %>%
ptd_spc(value_field = breaches, date_field = period, improvement_direction = "decrease",target=1200) %>%
summary()
```

You could assign this summary table to a variable and use it later:

```{r, eval=TRUE}
summary$variation_type
summary$assurance_type
```


### Interactive plots with Plotly

Expand Down
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ status](https://www.r-pkg.org/badges/version/NHSRplotthedots)](https://CRAN.R-pr
This package is built by the [NHS-R
community](https://nhsrcommunity.com) to provide tools for drawing
statistical process control (SPC) charts. This package supports NHS
England's [‘Making Data
Englands [‘Making Data
Count’](https://www.england.nhs.uk/publication/making-data-count/)
programme, and allows users to draw XmR charts, use change points, and
apply rules with summary indicators for when rules are breached.
Expand Down Expand Up @@ -94,6 +94,37 @@ sub_set %>%
)
```

In addition, you can use summary() function to get some basic statistics
about your SPC data frame. The function prints the SPC options, and then
returns the summarised results as a table:

``` r
summary<-sub_set %>%
ptd_spc(value_field = breaches, date_field = period, improvement_direction = "decrease",target=1200) %>%
summary()
#> Plot the Dots SPC options:
#> ================================
#> value_field: 'breaches'
#> date_field: 'period'
#> facet_field: not set
#> rebase: not set
#> fix_after_n_points: not set
#> improvement_direction:'decrease'
#> target: '1200'
#> trajectory: not set
#> screen_outliers: 'TRUE'
#> --------------------------------
```

You could assign this summary table to a variable and use it later:

``` r
summary$variation_type
#> [1] "common_cause"
summary$assurance_type
#> [1] "inconsistent"
```

### Interactive plots with Plotly

It’s also possible to generate interactive plots using the `{plotly}`
Expand Down
Loading