Skip to content

Commit

Permalink
Merge pull request #52 from ThomUK/add_finished_report_example
Browse files Browse the repository at this point in the history
Add finished report example
  • Loading branch information
ThomUK authored Nov 8, 2023
2 parents 2f55198 + 4953abf commit 854f62a
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 25 deletions.
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ knitr::opts_chunk$set(

# {SPCreporter}

{SPCreporter} is a simple way to add value to your performance reporting using statistical process control.
{SPCreporter} is a simple way to add value to your performance reporting using statistical process control. It produces reports similar to this [**example report**](report_examples/My_Example Report.html).

**Help sort signals from noise, and ensure your leadership are talking about signals that matter.**

Expand Down Expand Up @@ -65,7 +65,7 @@ spcr_make_report(

### See the vignettes for additional examples:

[Get Started vignette](https://thomuk.github.io/SPCreporter/articles/get_started.html) - Start here to produce your first reprot using data that is bundled into this package.
[Get Started vignette](https://thomuk.github.io/SPCreporter/articles/get_started.html) - Start here to produce your first report using data that is bundled into this package.

[Creating multiple reports](https://thomuk.github.io/SPCreporter/articles/multiple_reports.html) - An example of how to use {purrr} to automate groups of reports.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# {SPCreporter}

{SPCreporter} is a simple way to add value to your performance reporting
using statistical process control.
using statistical process control. It produces reports similar to this
[**example report**](report_examples/My_Example%20Report.html).

**Help sort signals from noise, and ensure your leadership are talking
about signals that matter.**
Expand Down Expand Up @@ -60,7 +61,7 @@ spcr_make_report(

[Get Started
vignette](https://thomuk.github.io/SPCreporter/articles/get_started.html) -
Start here to produce your first reprot using data that is bundled into
Start here to produce your first report using data that is bundled into
this package.

[Creating multiple
Expand Down
8 changes: 8 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@ url: https://thomuk.github.io/SPCreporter/
template:
bootstrap: 5

navbar:
structure:
left: [intro, report_examples, reference, articles, tutorials, news]
right: [search, github]
components:
report_examples:
text: Example Report
href: report_examples/My_Example Report.html
5 changes: 3 additions & 2 deletions man/SPCreporter-package.Rd

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

File renamed without changes.
47 changes: 29 additions & 18 deletions vignettes/get_started.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,40 @@ library(SPCreporter)

This vignette covers how to get started with {SPCreporter}. We are going to produce an example report using example files that are bundled into this package. Everything is self-contained. You'll have your first report in no time!

The example uses three _xlsx_ files which are located in the "example_data" folder of the package.
## Preliminary step

The example uses three _xlsx_ files which are located in the "example_data" folder of the package. This preliminary step is not necessary when working with your own data, but to access the files bundled with the package, we need to run this line.

```{r}
#| eval: false
# set up to read the package files. You will not need to do this to read your own data.
example_files <- system.file("example_data", package="SPCreporter")
path_to_example_files <- system.file("example_data", package="SPCreporter")
```

## 1. Read the data in

####
# 1. READ THE DATA FILES IN
#############################
```{r}
#| eval: false
# read in measure data from the two worksheets in the example file
measure_data <- list(
week = readxl::read_xlsx(file.path(example_files, "data.xlsx"), sheet = "week"),
month = readxl::read_xlsx(file.path(example_files, "data.xlsx"), sheet = "month")
week = readxl::read_xlsx(file.path(path_to_example_files, "data.xlsx"), sheet = "week"),
month = readxl::read_xlsx(file.path(path_to_example_files, "data.xlsx"), sheet = "month")
)
# read in the report config from example file
report_config <- readxl::read_xlsx(file.path(example_files, "report_config.xlsx"))
report_config <- readxl::read_xlsx(file.path(path_to_example_files, "report_config.xlsx"))
# read in measure config from example file
measure_config <- readxl::read_xlsx(file.path(example_files, "measure_config.xlsx"))
measure_config <- readxl::read_xlsx(file.path(path_to_example_files, "measure_config.xlsx"))
####
# 2. CREATE THE DATA BUNDLE
#############################
```

## 2. Create the data bundle

```{r}
#| eval: false
# create the data bundle
data_bundle <- spcr_make_data_bundle(
Expand All @@ -52,9 +59,12 @@ data_bundle <- spcr_make_data_bundle(
measure_config = measure_config
)
####
# 3. MAKE THE REPORT
#############################
```

## 3. Make the report

```{r}
#| eval: false
# make the report, including information for the six mandatory arguments.
spcr_make_report(
Expand All @@ -66,9 +76,10 @@ spcr_make_report(
author_email = "[email protected]"
)
```

You should now have an example report in your working directory
Success! Your rendered report should look like this [**example report**](/docs/report_examples/My_Example Report.html).

Once you have run this example, you might choose to move the three example config files to you own machine, and replicate the process again.

After running this example, the next stage is to move the example files to your machine, and start to modify them to create a report of your own data.
After that, start modifying the files to reflect your own data and reporting needs...
2 changes: 1 addition & 1 deletion vignettes/multiple_reports.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Creating multiple reports"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Example - creating multiple reports}
%\VignetteIndexEntry{Creating multiple reports}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand Down

0 comments on commit 854f62a

Please sign in to comment.